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('123@abc.com', 'Dateiupload', "Es wurde eine neue Datei hochgeladen
Dateiname: $dateiname", "from:123@abc.de");
} 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',
$(function() {
$('#data').uploadify({
...
'fileSizeLimit' : '500MB', // added this, set to whatever value you like
...
});
});
Then add this to your main .htaccess
file to override any default restrictions on your server (includes overriding your php.ini
file):
php_value upload_max_filesize 500M
php_value post_max_size 500M
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 set AllowOverride
options.
OPTION B:
Create a php.ini
file and store in the same root directory as your .htaccess
file. Add the two lines above and see if that works. If you're getting a 500 Internal
error using the last method, this probably won't work either. But you can try.
Did you try seeing if your php.ini settings were actually loaded, using phpinfo();
? Look at which php.ini
file was loaded.
Lastly, from my experience, if the correct php.ini file is loaded but the changes do not appear, try re-installing PHP, as a last resort.
Hope this helps!