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
Michele
Edit: I'm trying to use uploadify as Nick suggested.
<script type="text/javascript">
$(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
);
});
</script>
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?
here my test link: test
The test shows that files get uploaded but no files in the server's folder.
here is my upload.php 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;
}