![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hi All, I've written a simple script to upload a file as part of a form. Everything works fine on my system (win32, apache2, php4.3.1). However, when I upload the script to my host (linux, apache1.3, php4.3.2) it appears to have a file-size related issue. I can upload via a form ($_POST) and everything works as expected with files below approximately 500bytes. Any larger than this and I instantly get a "Cannot find server" error page. I have checked the relevant globals and settings on the host setup, with phpinfo(). Max post size is 4M, max memory is 8M. The rest of the post data is plain text of about 2k maximum. Any help appreciated. -- Fishter unhook to email me | http://www.fishter.org.uk/ "I'm sorry, but are you trying to emphasise your point with some sort of interpretive dance?" | |||
| Advertisements |
| | #2 | ||
| "Fishter" <ntalk@hook.fishter.org.uk> schreef in bericht news:wivjh33jrc3g.dlg@fishter.org.uk... > Hi All, > > I've written a simple script to upload a file as part of a form. > Everything works fine on my system (win32, apache2, php4.3.1). However, > when I upload the script to my host (linux, apache1.3, php4.3.2) it appears > to have a file-size related issue. > > I can upload via a form ($_POST) and everything works as expected with > files below approximately 500bytes. Any larger than this and I instantly > get a "Cannot find server" error page. > > I have checked the relevant globals and settings on the host setup, with > phpinfo(). Max post size is 4M, max memory is 8M. The rest of the post > data is plain text of about 2k maximum. > Check the value behind 'upload_max_filesize' in the output of phpinfo, perhaps there is something wrong here. Also, when you use the max_file_size hidden field in your upload form, remove it and see what happens then. JW | |||
| | #3 | ||
| how does the form and the script receiving data look like? "Janwillem Borleffs" <jwb@jwbfoto.demon.nl> schrieb im Newsbeitrag news:3f11b9c1$0$28913$1b62eedf@news.euronet.nl... > > "Fishter" <ntalk@hook.fishter.org.uk> schreef in bericht > news:wivjh33jrc3g.dlg@fishter.org.uk... > > Hi All, > > > > I've written a simple script to upload a file as part of a form. > > Everything works fine on my system (win32, apache2, php4.3.1). However, > > when I upload the script to my host (linux, apache1.3, php4.3.2) it > appears > > to have a file-size related issue. > > > > I can upload via a form ($_POST) and everything works as expected with > > files below approximately 500bytes. Any larger than this and I instantly > > get a "Cannot find server" error page. > > > > I have checked the relevant globals and settings on the host setup, with > > phpinfo(). Max post size is 4M, max memory is 8M. The rest of the post > > data is plain text of about 2k maximum. > > > > Check the value behind 'upload_max_filesize' in the output of phpinfo, > perhaps there is something wrong here. > > Also, when you use the max_file_size hidden field in your upload form, > remove it and see what happens then. > > JW > > > | |||
| | #4 | ||
| Hi Janwillem Borleffs In news:3f11b9c1$0$28913$1b62eedf@news.euronet.nl you wrote: > Check the value behind 'upload_max_filesize' in the output of phpinfo, > perhaps there is something wrong here. This is set to 4M, the same as max_post_size. I cannot change this value. > Also, when you use the max_file_size hidden field in your upload form, > remove it and see what happens then. Max_file_size was set to 10000. Removing the <input /> tag had no effect. Increasing the value to 1000000000 had no effect either. -- Fishter unhook to email me | http://www.fishter.org.uk/ "Chaos, panic, & disorder - my work here is done." | |||
| | #5 | ||
| Hi Erik In news:besdv7$3iq$05$1@news.t-online.com you wrote: > how does the form and the script receiving data look like? Please bear in mind that the script works OK for small files, but fails for large (500byte) files. Also, that the error is a plain old 'Cannot connect to server'. The section of form looks like this: <form enctype="multipart/form-data" action="index.php?page=observer &action=editperson&key=12" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /> <input name="form_file" type="file" /> And the receiving script looks like: if($_FILES['form_file']['tmp_name']!="") { echo $_FILES['form_file']['tmp_name']."<br />"; //debug echo $_FILES['form_file']['name']."<br />"; //debug $file_extension = strrchr($_FILES['form_file']['name'],'.'); echo strtolower($picname = "/observers/images/" . //echo is debug strip_tags($_POST['form_firstname'] . "_" . $_POST['form_surname']) . $file_extension); if(move_uploaded_file($_FILES['form_file']['tmp_name'],$docroot.$picname)) { echo "<p>Success!</p>"; } else echo "<p> failed to move uploaded file</p>"; } -- Fishter unhook to email me | http://www.fishter.org.uk/ You are validating my inherent mistrust of strangers. | |||
| | #6 | ||
| I had the very same problem a few days ago, and it was about a configuration on the Apache server. I know how to code, but know almost nothing on Linux/Apache configuration, and I was not the one who fixed the problem. All I know is that a configuration file that sets the maximum upload size was changed and everything worked fine then. Sorry for not being of great help, but I hope this info be useful. Rafael Cotta "Fishter" <ntalk@hook.fishter.org.uk> escreveu na mensagem news:1qcff4fsscire$.dlg@fishter.org.uk... > Hi Janwillem Borleffs > In news:3f11b9c1$0$28913$1b62eedf@news.euronet.nl you wrote: > > Check the value behind 'upload_max_filesize' in the output of phpinfo, > > perhaps there is something wrong here. > > This is set to 4M, the same as max_post_size. I cannot change this value. > > > Also, when you use the max_file_size hidden field in your upload form, > > remove it and see what happens then. > > Max_file_size was set to 10000. Removing the <input /> tag had no effect. > Increasing the value to 1000000000 had no effect either. > > -- > Fishter > unhook to email me | http://www.fishter.org.uk/ > "Chaos, panic, & disorder - my work here is done." | |||
| | #7 | ||
| Hi Rafael Cotta In news:3f11d911$1@news.iis.com.br you wrote: > All I know is that a configuration file that sets the maximum upload size > was changed and everything worked fine then. > Sorry for not being of great help, but I hope this info be useful. Unfortunately it looks like the max_file_size is set correctly. Thanks for your help anyway. -- Fishter unhook to email me | http://www.fishter.org.uk/ I'll give you a quid if you promise not to reproduce | |||
| | #8 | ||
| Hi Fishter In news:a8s64q5nr2in$.dlg@fishter.org.uk you wrote: >> how does the form and the script receiving data look like? > Please bear in mind that the script works OK for small files, but fails for > large (500byte) files. Also, that the error is a plain old 'Cannot connect > to server'. Problem found, but not resolved! My ISP (ntl) has a transparent proxy between me and the rest of the world. Apparently this is malfunctioning causing any POST data to be limited to 0.5KB. I have managed to specify a proxy server other than the malfunctioning one, and all is well again. Thanks to all for their assistance. -- Fishter unhook to email me | http://www.fishter.org.uk/ You do realise that Gilligan and Skipper are never going to get off that island? | |||
| | #9 | ||
| Hi Shawn Wilson In news:3F158414.CAC35986@glassgiant.com you wrote: >> Unfortunately it looks like the max_file_size is set correctly. > What's upload_max_filesize in phpinfo() set to? You did mean 500 bytes, not > 500 kbytes, right? The upload_max_filesize is 4M. I could not upload anything over 0.5kbytes. The problem was eventually traced to my ISP's transparent proxies malfunctioning and not allow any POST data over 0.5kbyte to be transmitted. Strange error, but bypassing the proxies has cured my problem. -- Fishter unhook to email me | http://www.fishter.org.uk/ Do you trip over cordless phones too? | |||
| Featured Websites | ||||
|
![]() |
| Tags: file, problem, upload |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with safe mode and file uploads | Eric Haskins | PHP | 0 | 07-01-2007 3:35 PM |
| Upload | Frank | HTML | 1 | 07-01-2007 2:01 PM |
| Upload to computer | Tim Sperry | GPS | 2 | 06-12-2007 5:13 PM |
| new file problem | CoolSnake37 | Graphics in general | 6 | 06-11-2007 11:08 PM |
| Large Flat File to Database Problem | Christopher Smith | Database | 0 | 06-10-2007 12:19 AM |
| Featured Websites | ||||
|