Note that there are some explanatory texts on larger screens.

plurals
  1. POUploadify: Write complete but there are no files uploaded
    text
    copied!<p>I want upload images with uploadify v.3.1 (flash). I click on select files, choose a file, the file is uploaded but in the end I get the error message:</p> <p><code>haus2.jpg (256KB) - HTTP Error (401)</code></p> <p><code>php.ini</code> settings:</p> <pre><code>memory_limit: 256M upload_max_filesize: 40M post_max_size: 8M </code></pre> <p>My php file where I use uploadify:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $(function() { $('#image_upload1').uploadify({ 'swf' : '/project/swf/uploadify.swf', 'uploader' : '/project/includes/uploadify.php', 'cancelImg' : '/project/images/static/uploadify-cancel.png', 'folder' : '/project/images/uploaded/&lt;?php echo $_SESSION['newCreatedID']; ?&gt;', 'multi' : true, 'auto' : true, 'removeCompleted': false, 'queueSizeLimit' : 10, 'simUploadLimit' : 10, 'fileExt' : '*.jpg; *.jpeg; *.png; *.gif', 'fileDesc' : 'JPG Image Files (*.jpg); JPEG Image Files (*.jpeg); PNG Image Files (*.png), GIF (*.gif)', 'onUploadError' : function(file, errorCode, errorMsg, errorString) { alert('The file ' + file.name + ' could not be uploaded: ' + errorString); }, 'onUploadSuccess': function(file, data, response) { alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data); } }); }); }); &lt;/script&gt; &lt;form action="step2_do.php" name="newEntry" id="newEntry" method="post" enctype="multipart/form-data"&gt; &lt;input id="image_upload1" name="image_upload1" type="file" /&gt; &lt;input type="submit" value=" Submit" id="submit-btn" class="inputform" /&gt; &lt;/form&gt; </code></pre> <p>There is no error thrown.</p> <p>But there is no error. In Firebug there is never an error shown. The uploaded folder has 777 rights and I removed the proposed <code>.htaccess</code> in there.</p> <p><code>uploadify.php</code>:</p> <pre><code>if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/'; $targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name']; mkdir(str_replace('//','/',$targetPath), 0777, true); move_uploaded_file($tempFile,$targetFile); echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile); } </code></pre> <p>I cannot find any error. What are my possibilites to debug?</p> <p>I don't get any errors with</p> <pre><code>error_reporting(E_ALL); ini_set("display_errors", 1); </code></pre> <p><strong>Edit:</strong></p> <p>Now I completely forgot about a htaccess needing a password for accessing the site. Now fileupload is writing complete but there is no folder/files on the server. I implemented <code>onUploadSuccess</code> which brings me the following error message:</p> <pre><code>The file haus.jpg was successfully uploaded with a response of true:&lt;br /&gt; &lt;b&gt;Warning&lt;/b&gt;: mkdir() [&lt;a href='function.mkdir'&gt;function.mkdir&lt;/a&gt;]: File exists in &lt;b&gt;/home/myuser/www/home/project/includes/uploadify.php&lt;/b&gt; on line &lt;b&gt;21&lt;/b&gt;&lt;br /&gt; /haus.jpg </code></pre> <p>The main problem was that I mixed up the old API of uploadify with the new one. For debugging I used: </p> <pre><code>$request = implode(";", $_REQUEST); file_put_contents('uploadify.txt', chr(10) . ": request" . $request, FILE_APPEND); </code></pre> <p>My final initialization looks like:</p> <pre><code>$(document).ready(function(){ $(function() { $('#image_upload1').uploadify({ 'swf' : '/project/swf/uploadify.swf', 'uploader' : '/project/includes/uploadify.php', 'formData' : {'folder' : '/project/images/uploaded/&lt;?php echo $_SESSION['newCreatedID']; ?&gt;'}, 'multi' : true, 'auto' : true, 'removeCompleted': false, 'queueSizeLimit' : 10, 'simUploadLimit' : 10, 'fileTypeExt' : '*.jpg; *.jpeg; *.png; *.gif', 'fileTypeDesc' : 'JPG Image Files (*.jpg); JPEG Image Files (*.jpeg); PNG Image Files (*.png), GIF (*.gif)', 'onUploadError' : function(file, errorCode, errorMsg, errorString) { alert('The file ' + file.name + ' could not be uploaded: ' + errorString); }, 'onUploadSuccess': function(file, data, response) { alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data); } }); }); }); </code></pre> <p><code>formData</code> should be used ...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload