Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML/PHP/JS Select multiple file and upload via FTP
    primarykey
    data
    text
    <p>Hy, I need to upload a series of files to a server (in specific a set of images). I need a single file input to select multiple files (also in IE), I have no permission to write directly with PHP on the server (permission are 775 but FTP and apache users are into 2 different groups) so I need to use an FTP connection (I'm already able to do this with a single file). Can someone advice me if there is someway to do this? Thanks in advance</p> <p>Michele</p> <p>Edit: I'm trying to use uploadify as Nick suggested.</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#file_upload').uploadify({ 'uploader' : 'JS/uploadify.swf', 'script' : 'upload.php', 'cancelImg' : 'JS/cancel.png', 'folder' : 'TEST/UPLOADS', 'auto' : true, 'multiple' : true, 'removeCompleted' : false, 'queueSizeLimit' : 3, 'queueID' : 'queue', 'simUploadLimit' : 1 ); }); &lt;/script&gt; </code></pre> <p>I tried to put ftp connection and ftp_put into upload.php it is right?? If I try to add the 'scriptData' parameter it cannot be accessible by $_POST[] as suggested by documentation, why?</p> <p>here my test link: <a href="http://www.wpr.it/TEST" rel="nofollow">test</a></p> <p>The test shows that files get uploaded but no files in the server's folder.</p> <p>here is my upload.php code:</p> <pre><code>if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; // 1 //$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/'; // 2 //$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name']; // 3 $ftp_server = "***"; //address of ftp server. $ftp_user_name = "***"; // Username $ftp_user_pass = "***"; // Password $conn_id = ftp_connect($ftp_server); ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); ftp_pasv ( $conn_id, true ); if( ftp_fput($conn_id, 'TEST/' . $_FILES['Filedata']['name'], $tempFile, FTP_BINARY)){ // 4 echo true; }else{ echo false; } ftp_close($conn_id); } else { echo false; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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