I'm using uploadify v.3.2, which i used in an older project as well, there it works fine!
But now i'm trying to upload files up to 500 MB on another server. But the script only uploads files up to 7.9 MB...
My php-info tells:
upload_max_filesize 512M
post_max_size 512M
And this is the script I'm using in my HTML-Template:
$(function() {
$('#data').uploadify({
'formData' : {
'timestamp' : '1349443065',
'token' : '94a031393fe2f786fdfc14c0cd432204'
},
'swf' : './includes/uploadify.swf',
'uploader' : './includes/uploadify.php',
'buttonText' : 'choose file',
'onUploadSuccess' : function(file, data, response) {
alert('Die Datei ' + file.name + ' wurde erfolgreich hochgeladen!'); },
'checkExisting' : './includes/check-exists.php'
});
});
this is the code of the uploadify.php:
// Define a destination
$targetFolder = '/upload'; // Relative to the root
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type
$fileTypes = array('zip','rar','sit'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
$dateiname = $targetFile;
$ersetzen = '/homepages/37/d24392003/htdocs/modx/upload/';
$dateiname = str_replace($ersetzen, "", $dateiname);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
mail('[email protected]', 'Dateiupload', "Es wurde eine neue Datei hochgeladen\n\nDateiname: $dateiname", "from:[email protected]");
} else {
echo 'Invalid file type.';
}
}
So the script works, the php-configuration seems fine...anyone has any tipps what to do?
Cheers!
Set the file size limit as an option:
'fileSizeLimit' : '500MB',Then add this to your main
.htaccessfile to override any default restrictions on your server (includes overriding yourphp.inifile):If you are getting
500 - Internal Server Error, that likely means you don't have permission to set these values by.htaccess. You'll have to contact your web server provider. Ask them to allow you to setAllowOverrideoptions.OPTION B:
Create a
php.inifile and store in the same root directory as your.htaccessfile. Add the two lines above and see if that works. If you're getting a500 Internalerror using the last method, this probably won't work either. But you can try.