Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   existence and size of client file (http://www.velocityreviews.com/forums/t897467-existence-and-size-of-client-file.html)

Asterbing 04-14-2006 12:00 PM

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

Jürgen Exner 04-14-2006 12:09 PM

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



Asterbing 04-14-2006 01:50 PM

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.

Gunnar Hjalmarsson 04-14-2006 02:06 PM

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

Asterbing 04-14-2006 02:29 PM

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.

Jürgen Exner 04-14-2006 02:40 PM

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



Asterbing 04-14-2006 03:01 PM

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 ?

A. Sinan Unur 04-14-2006 03:18 PM

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

Jürgen Exner 04-14-2006 03:36 PM

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




Gunnar Hjalmarsson 04-14-2006 04:44 PM

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.


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