![]() |
existence and size of client file
Is there a way to test the existence and size of a client file ? This to
avoid any unuseful traffic (upload, serveur file test, unlink if too big) and report to user as fast as possible (upload limit being high in some cases I've to treat ; some tenth of MB). |
Re: existence and size of client file
Asterbing wrote:
> Is there a way to test the existence and size of a client file ? Depending on what kind of client you are talking about, maybe. Like for mirroring systems that's a key functionality. But what does that have to do with Perl? jue |
Re: existence and size of client file
In article <KhM%f.20266$wH1.3677@trnddc03>, jurgenex@hotmail.com says...
> Asterbing wrote: > > Is there a way to test the existence and size of a client file ? > > Depending on what kind of client you are talking about, maybe. Like for > mirroring systems that's a key functionality. > Oh no, in framework of a CGI. > But what does that have to do with Perl? Because I'm talking about CGI written in Perl for which I've to incorporate a feature which will allow users to upload a file. So, my question was implicitely about Perl, but could be explicitely reformulated as this : "Is there a way to test the existence and size of a client file in a CGI written in Perl ? -e and -s are server-side only, unless mistake. |
Re: existence and size of client file
Asterbing wrote:
> Is there a way to test the existence and size of a client file ? This to > avoid any unuseful traffic (upload, serveur file test, unlink if too > big) Maybe you want to check the $ENV{CONTENT_LENGTH} variable before upload. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl |
Re: existence and size of client file
In article <4a9oigFs7lqnU1@individual.net>, noreply@gunnar.cc says...
> Asterbing wrote: > > Is there a way to test the existence and size of a client file ? This to > > avoid any unuseful traffic (upload, serveur file test, unlink if too > > big) > > Maybe you want to check the $ENV{CONTENT_LENGTH} variable before upload. > > Well, but the form will only POST the path to file for uploading, not the length of the file data itself. |
Re: existence and size of client file
Asterbing wrote:
> In article <KhM%f.20266$wH1.3677@trnddc03>, jurgenex@hotmail.com > says... >> Asterbing wrote: >>> Is there a way to test the existence and size of a client file ? >> >> Depending on what kind of client you are talking about, maybe. Like >> for mirroring systems that's a key functionality. > > Oh no, in framework of a CGI. I suppose you mean HTTP because for the Commone Gateway Interface there isn't really a client unless you call the CGI program the client because the other end of the communication line is a web server. And no, the HTT-Protocol does not provide any means for such inquiries by the server to the client. If you think about it it would be quite a security hole if there was such a method, wouldn't it? >> But what does that have to do with Perl? > > Because I'm talking about CGI written in Perl Which still doesn't make it a question about Perl because your question and the answer would be exactly the same even if your CGI program would be written in C or LOGO or Pascal or Prolog. First of all you have a question about HTTP, then maybe about CGI. jue |
Re: existence and size of client file
In article <9vO%f.9$7w6.2@trnddc02>, jurgenex@hotmail.com says...
> First of all you have a question about HTTP, then maybe about CGI. > Seen this way, yes, but I could reformulate indefinitively and a day or another find the angle you wish... For example : does -e, -s or open authorized to reach client-side files ? |
Re: existence and size of client file
Asterbing <no@thanks.com> wrote in
news:MPG.1ea9d7a087f43d3c9897ea@news.tiscali.fr: > In article <9vO%f.9$7w6.2@trnddc02>, jurgenex@hotmail.com says... >> First of all you have a question about HTTP, then maybe about CGI. >> > > Seen this way, yes, but I could reformulate indefinitively and a day or > another find the angle you wish... As someone else mentioned in a different thread recently, I know what the words mean but the sentence above makes no sense. > For example : does -e, -s or open authorized to reach client-side files ? What client? NFS, SSH etc? Your question has been answered already: A CGI script running on a web server has no way of inspecting the file system on the HTTP client that is making the request to the web server. The question has nothing whatsoever to do with Perl, and your attempt to get cute is not appreciate it. Bye. Sinan |
Re: existence and size of client file
Asterbing wrote:
> In article <9vO%f.9$7w6.2@trnddc02>, jurgenex@hotmail.com says... >> First of all you have a question about HTTP, then maybe about CGI. >> > > Seen this way, yes, but I could reformulate indefinitively and a day > or another find the angle you wish... For example : does -e, -s or > open authorized to reach client-side files ? Answer: Yes, if you are talking about e.g. an NFS client or if files are shared between computers. No, if you are talking about e.g. an HTTP client. Again, which part of "this has nothing to do with Perl but only with your application domain" don't you understand? jue |
Re: existence and size of client file
Asterbing wrote:
> In article <4a9oigFs7lqnU1@individual.net>, noreply@gunnar.cc says... >>Asterbing wrote: >>>Is there a way to test the existence and size of a client file ? This to >>>avoid any unuseful traffic (upload, serveur file test, unlink if too >>>big) >> >>Maybe you want to check the $ENV{CONTENT_LENGTH} variable before upload. > > Well, but the form will only POST the path to file for uploading, not > the length of the file data itself. True, but $ENV{CONTENT_LENGTH} will hold the length of the whole request, and if it exceeds a certain value, it may not be desirable to even parse the request. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl |
| All times are GMT. The time now is 06:20 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.