Web Servers on Unix and Linux - Uploading data via CGI fails for large files

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > August 2007 > Uploading data via CGI fails for large files





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Uploading data via CGI fails for large files
fchristl@gmail.com

2007-08-02, 1:17 pm

Hello group,

I am momentarily trying to program a CGI upload script in ruby. It
simply reads out the STDIN, gets a given user ID and saves the
uploaded file according to the original filename and the given user
ID.
The script is working fine for files under about 50 KB - but as soon
as a file is bigger, the uploading process simply does not finish -
the page loads inifinitely and does not stop.
I've tried multiple operating system - browser - combinations and the
problem is the same everywhere.
Since the script is working fine with small files, I guess that the
problem is on the server side.
I also tried to do the same thing with other scripting languages (with
Perl and Python) and it is the same problem with every scripting
language.
I am using Apache2-2.2.3-4 with Ruby 1.8.5 on Debian unstable (though
that shouldn't help...). I

Does anyone have any kind of clue what is going wrong on my server?

Thanks in advance!
Felix

John Murtari

2007-08-02, 1:17 pm

fchristl@gmail.com writes:

> I am momentarily trying to program a CGI upload script in ruby. It
> simply reads out the STDIN, gets a given user ID and saves the
> uploaded file according to the original filename and the given user
> ID.
> The script is working fine for files under about 50 KB - but as soon
> as a file is bigger, the uploading process simply does not finish -
> the page loads inifinitely and does not stop.
> I've tried multiple operating system - browser - combinations and the
> problem is the same everywhere.
> Since the script is working fine with small files, I guess that the
> problem is on the server side.
> I also tried to do the same thing with other scripting languages (with
> PERL and Python) and it is the same problem with every scripting
> language.
> I am using Apache2-2.2.3-4 with Ruby 1.8.5 on Debian unstable (though
> that shouldn't help...). I
>
> Does anyone have any kind of clue what is going wrong on my server?


I agree that your problem is on the server, especially if the
same thing occurs with all scripting languages and browsers and it
starts the moment you go over a certain size, like 50 KB.

You may find something in the apache config files, check
for any memory/usage limits that might be set. Also, on debian
check for how the system applies resource limits to individual
users. One simple test that might help is if you normally run
your serve as 'nobody' or another test user id, try to run it
as 'root' briefly and try the upload -- that would at least
eliminate a user resource limit. Also, uploads first normally
go to some type of 'tmp' directory first, make sure their are
no disk/quota limitation there.

Hope this helps.

--
John
________________________________________
___________________________
John Murtari Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)
http://thebook.com/
fchristl@gmail.com

2007-08-03, 7:17 am

Thank you, John - problem served!
There was a mistake in my application concept: I simply tried to store
all data in the memory and then to push it once the upload is finished
into a file. So the script exceeded the memory limits. Now it is
working fine.

But now (I do not want to open a new thread for this), I have another
problem:
I implemented a bar which shows the process to the user by calculating
the percentage of data that has been uploaded (ENV["CONTENT_LENGTH"]
and the already read size of data). This is working fine, as well for
small files but when it comes to large files, no data is sent back to
the browser until the file has been uploaded for about three quarters.
This problem, again, only occurs when uploading files bigger than
about 50K.
Any idea?

Thank you and have a nice da!

C.

2007-08-07, 1:16 pm

On 2 Aug, 18:43, John Murtari <jmurt...@thebook.com> wrote:
> fchri...@gmail.com writes:
>
>
> I agree that your problem is on the server, especially if the
> same thing occurs with all scripting languages and browsers and it
> starts the moment you go over a certain size, like 50 KB.
>
> You may find something in the apache config files, check
> for any memory/usage limits that might be set. Also, on debian
> check for how the system applies resource limits to individual
> users. One simple test that might help is if you normally run
> your serve as 'nobody' or another test user id, try to run it
> as 'root' briefly and try the upload -- that would at least
> eliminate a user resource limit.


Improbable - but easily testable without going to this extent - if you
can upload 4 x 50Kb files, but - after deleting them - can't upload a
200kb file then its nothing to do with quotas.

Check your apache config for LimitRequestBody

C.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com