<input type="file">-problem

couzteau

Registered
hello,

i 've got a very strange problem and i havn't got a clue how to solve it:

I made a little website to upload files via http a. it also submits some data in text form. nothing special. i implemeted it using perl/cgi. it is hosted on an imac running 10.2.4, very basic stuff. the imac is connected to the internet in the it-department of a large company. currently i don't know how the routing and the firewalls work (but i can find out if necessary)

the strange thing is:
using the site (uploading files and submitting text) works fine on some machines and on others it works partially(only submitting text works). it depends on how or where the machine is connected to the internet, ie i can hook up my ibook at home directly to my dsl line and have no problem at all, (uploading files and submitting text work fine). when i hook it up via another machine that serves as an internetrouter (from my kitchen) i can browse the site, i can submit text data, but i cannot submit files:
i use the following html-code for submitting the file:

<form action="http://my.server.org/cgi-bin/beam.pl" method="post" enctype="multipart/form-data">
<input type="file" name="myfile" accept="text/*" maxlength="2097152">
<input type="submit" value="upload"><input type="reset">
</form>

when i hit submit in one of the problem locations (i.e my kitchen) nothing happens until the browser errors with a timeout. there is no entry in the logfile of the webserver (neither error nor access_log) .

hosting the site on a different machine (ie a sun running solaris/apache 1.2.7, or my g4 running osx 10.2.4 with dsl) solves the problem. it must run on the imac though, i can use the other servers for testing purposes only.

i'm very sure this is not a browser issue. i'm not sure whether the problem lies on the server or a client machine. i assume it has nothing to do with the code that's used on the site. it's very simple and plain.

thanx in advance for your help
 
Hmmm

Symptom: binary files don't upload, plain text does, and only when behind some routers?

It sounds like there's a router issue. It would be kind of strange though, since most firewalls allow outgoing connections by default.

Something else I can think of: I believe files are sent over HTTP using the same connection as the rest of the form, but posted files may open another connection on a high port, I'm not sure (but it sounds unlikely). If that is the case, then firewall blocking may be responsible.

It doesn't sound like it has anything to do with your Perl script.

Incidentally, does the server have any limitations on the amount of time scripts are allowed to execute? I have had issues before where scripts have aborted because they executed for too long (i.e., waiting for the large binary file to be uploaded). It's fixable by increasing the maximum execution time on the server.

Now that's in reference to PHP4, I'm not sure if Perl5 has execution capping or not...
 
thank you very much for your analysis. i partly found out what was going wrong last night.

there are two problems:
1. the server-machine has two names. one is visible inside the companies lan the other to the outside world and on the lan as well. my code uses the outside-name which is incompatible with the inside-name due to the javascript-object 'opener' which is null when the domainname of the opening window is different than the domain of the target window. my website uses this to open a window when the upload begins and to close it when it finishes.

2. i'm using osx built in internet sharing to provide internetaccess in my kitchen. i believe this is part of the problem. but it remains mysterious. all i can say is, that internet sharing seems to be buggy. the file uploads definitely use prt 80, and this problem has nothing to do with javascript because, I've reduced the html-code to the single form that transmits the file and the problem remains the same. sometimes i have trouble browsing other sites from my kitchen. ironically www.apple.com doesn't work and software-update also doesn't work. it says it was unable to connect to the internet, while i'm happily reading the news on slashdot. so I'm quite sure now, that the routing problem lies within apple's internet sharing.

Incidentally, does the server have any limitations on the amount of time

good idea but this is not the case. where can i find out more about the routing issue with apple's internet sharing?

thank you very much.
 
Back
Top