Jump to content

Problem uploading larger files


pornflakes

Recommended Posts

Hi guys,

this upload works fine for small files but shows blank page when I try bigger files (> 1Mb)

 

<form action="upload.php" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="file">
<input type="submit" value="Upload">
</form>

<br />

<?php
$target_path = "uploads/";
$target_path = $target_path . basename( @$_FILES['file']['name']);

if(move_uploaded_file(@$_FILES['file']['tmp_name'], $target_path)) {
  echo '<span style="color:green">File ' . basename(@$_FILES['file']['name']) . ' has been uploaded</span>';
} else{
    echo '<span style="color:red">File could not be uploaded</span>';
}
?>

 

Any ideas/suggestion are appreciated.

Thanks

Link to comment
https://forums.phpfreaks.com/topic/173530-problem-uploading-larger-files/
Share on other sites

Ok, I checked phpinfo() and altered upload_max_filesize

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 30M

 

this works for some files now but some .rar files still can´t be uploaded

 

<input type="hidden" name="upload_max_filesize" value="20000000" />

 

Will adding this line overwrite the value in php.ini ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.