Uploadify FOLDER

巧了我就是萌 提交于 2019-12-05 16:07:40

I solved the issue,it is a bug in uploadify : The uploadify folder variable is not straight forward ,so that we should add a slash before that.

so it would be var folder = "/"+ "FolderName"; The problem is u cant return the data on server if u use just Folder name.

I will think you will get a lot of help to put your output into a file, :)

$myFile = "[full-folder-path]testFile.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = $_FILES['Filedata']['name'] ." | ". print_r( $_REQUEST, true ) ."\n";
fwrite($fh, $stringData);
fclose($fh);

But i think if you changes your line $targetPath to this

$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';

Remeber your folder need read/wirte rulls, its the only thing i can see its worng from your basic script to my script.

Just provide the folder where you want to upload in the settings as

<script type="text/javascript">
$(document).ready(function() {
  $('#file_upload').uploadify({
    'uploader'  : '/uploadify/uploadify.swf',
    'script'    : '/uploadify/uploadify.php',
    'cancelImg' : '/uploadify/cancel.png',
    'folder'    : '/uploads',
    'auto'      : true
  });
});
</script>

As in the above settings you missed out the folder option.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!