Skip to content

Instantly share code, notes, and snippets.

View abacha's full-sized avatar

Adriano Bacha abacha

  • São Paulo, SP
  • 10:38 (UTC -03:00)
View GitHub Profile
We couldn’t find that file to show.
<?
class Nome-do-modeloTestCase extends CakeTestCase {
var $fixtures = array ('app.Nome-do-modelo');
}
?>
We couldn’t find that file to show.
We couldn’t find that file to show.
We couldn’t find that file to show.
<?=$javascript->link(array("jquery-1.3.2.min", "jquery.uploadify.v2.1.0.min", "swfobject"));?>
<?=$html->css(array("uploadify"));?>
<?
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
$fileTypes = str_replace('*.','',$_REQUEST['fileext']);
$fileTypes = str_replace(';','|',$fileTypes);
$typesArray = split('\|',$fileTypes);
$fileParts = pathinfo($_FILES['Filedata']['name']);
<?= $form->file("upload") ?>
<a href="javascript:jQuery('#BookUpload').uploadifyUpload();">Upload</a>
<a href="javascript:jQuery('#BookUpload').uploadifyClearQueue();">Clear</a>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('#BookUpload').uploadify({
'uploader':'/uploadify/uploadify.swf',
'script':'/uploadify/uploadify.php',
'cancelImg':'/uploadify/cancel.png',
'folder':'/uploadify/files/<?=$_SESSION["Config"]["userAgent"]?>',
'fileExt':'*.zip;*.pdf;*.rar;*.txt;*.doc;*.xls;*.docx;*.xlsx;*.chm;*.tar;*.tar.gz;*.tgz;*.tar.bz;*.tar.bz2',
'fileDesc':'*.zip;*.pdf;*.rar;*.txt;*.doc;*.xls;*.docx;*.xlsx;*.chm;*.tar;*.tar.gz;*.tgz;*.tar.bz;*.tar.bz2',
<?
function beforeSave() {
if (isset($_SESSION["Config"]["userAgent"]))
$this->data["BookFiles"] = $this->uploadFiles();
return true;
}
function uploadFiles() {
$dir = "uploadify/files/".$_SESSION["Config"]["userAgent"]."/";
if (is_dir($dir)) {
$handle = opendir($dir);