Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have PHP on my RH9 system...
when i run an upload script... and press button upload, it automatically diverts the page to google.co with search string of google.. why does this happen and how can this be stopped??
This is my upload script... the post and get variables are passing fine but then when i try to upload using this script.. it goes to google... with a search string of localhost..
Max Upload is set to 80MB in php.ini and i am trying to upload just 1 MB file.. also uploads have bee set on..
please suggest
Regards
Xing
$action = $HTTP_POST_VARS["action"];
$max_size = "50000000"; // Max size in BYTES (1MB)
$updir = "/var/www/html";
echo "
$updir<br>$action<br>
<b>Uploader</b><br>
<form action='upl.php' method=post enctype='multipart/form-data'>
File (max size: $max_size bytes/".($max_size/1024)." kb):<br>
<!-- This is NOT a secure method of checking filesize, but it tells the user if he tried to upload a file too big before
he waits for the huge file to upload, make sure to check the filesize after the form is sent as well -->
<!-- <input type='hidden' name='MAX_FILE_SIZE' value='$max_size'> (removed because it wasn't working properly) -->
<input type='file' name='filename'><br>
<input type='hidden' name='action' value='upload'>
<input type='submit' value='Upload File'>
</form>";
if ($action == 'upload')
{
print "teri jai ho";
exit;
if ($_FILES["filename"]["size"] > $max_size) die ("<b>File too big! Try again...</b>");
copy($_FILES["filename"]["tmp_name"],$updir.$_FILES["filename"]["name"]) or die("<b>Unknown error!</b>");
//copy($_FILES["filename"]["tmp_name"],"./".$_FILES["filename"]["name"]) or die("<b>Unknown error!</b>");
echo "<b>File Uploaded.</b>"; // for debug --> $filename --> ".$destination."/".$filename_name."</h2>";
}
Have you tried to upload a small file? Check your php.ini file, see if you are allowed to upload files, and what the max size is. Take a look at /etc/apache2/conf/modules.d/70_mod_php.conf too.
Originally posted by david_ross Have you tried it in other browsers?
i tried konqueror on you advice .. as you can noice from my script it has a max size of 50000000 bytes.. that makes it about 40000 KB.. now when i tried to upload a 40 KB file, it tried to do so but actually could not do it giving this error
Unable to create '/var/www/htmlinstall.log': Permission denied in /var/www/html/upl.php on line 46
line 46 is the line where copy is taking place .. i will look into it and post the results...
when i tried to upload a 1.1 MB file, it gave me this error...
why did this happen?? as max_file_size in upload file is much more than 10MB and upload limit and max post size in php.ini is around 80 MB why did this happen??
This problem has to be solved because i have been requested by at least 10 people to forward the solution to them.. so this problem has quite a wide base.
OK People.. This is the recent bit of research i have done and this is to be taken care of..
In php.conf, which is a httpd file, we have to take care of this value
LimitRequestBody
Set this to a higher value.. this governs the upload limit of your script as well... but my script is still giving me troubles... so lets see further.. till then
Originally posted by david_ross There is also a max upload size in php.ini
i have written in a previous post that max upload size is set to 80MB. Also max post size is set to 80MB.. i think we should concentrate on the issue of why permission is being denied inspite of full permission to executing script and the file that is to be uploaded?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.