Computer Webmaster Gaming Console Graphics Forum

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.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

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.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 3:36 PM   #1
Fishter
 
Fishter's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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?"
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 07-01-2007, 3:36 PM   #2
Janwillem Borleffs
 
Janwillem Borleffs's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem


"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



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 3:36 PM   #3
Erik
 
Erik's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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
>
>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 3:36 PM   #4
Fishter
 
Fishter's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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."
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 3:36 PM   #5
Fishter
 
Fishter's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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
&amp;action=editperson&amp;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.
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 3:36 PM   #6
Rafael Cotta
 
Rafael Cotta's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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."



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 3:37 PM   #7
Fishter
 
Fishter's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 3:38 PM   #8
Fishter
 
Fishter's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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?
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 3:39 PM   #9
Fishter
 
Fishter's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default File upload problem

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?
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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




All times are GMT +1. The time now is 12:02 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98