Jump to content

File Uploading


jaikar

Recommended Posts

 

Hi,

 

which config decides the size of the file to be uploaded, is it upload_max_filesize or post_max_size ?

 

on my server

post_max_size = 8M

upload_max_filesize = 2M

 

i uploaded a file for 3M and its not getting saved in the directory.. if Upload_max_filesize decides the file size then what for post_max_size is used... ? can anyone help ? :-)

 

 

Thanks in Advance !!...

 

~J

 

Link to comment
https://forums.phpfreaks.com/topic/42475-file-uploading/
Share on other sites

if($_POST["action"] == "Upload Image")
{
unset($imagename);

if(!isset($_FILES) && isset($HTTP_POST_FILES))
$_FILES = $HTTP_POST_FILES;

if(!isset($_FILES['image_file']))
$error["image_file"] = "An image was not found.";


$imagename = basename($_FILES['image_file']['name']);
//echo $imagename;

if(empty($imagename))
$error["imagename"] = "The name of the image was not found.";

if(empty($error))
{
$newimage = "uploads/" . $imagename;
//echo $newimage;
$result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimage);
if(empty($result))
echo "Profile Pic updated";
}else{ echo "Invalid Filename, Please change its name to your username.";
$error["result"] = "There was an error moving the uploaded file.";
}}

 

extract of a code i made a long time ago to upload images...

Link to comment
https://forums.phpfreaks.com/topic/42475-file-uploading/#findComment-206059
Share on other sites

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.