[27196] in Perl-Users-Digest
Perl-Users Digest, Issue: 9009 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 2 00:05:45 2006
Date: Wed, 1 Mar 2006 21:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 1 Mar 2006 Volume: 10 Number: 9009
Today's topics:
Upload file format checking <spam@nospam.com>
Re: Upload file format checking xhoster@gmail.com
Re: Upload file format checking <noreply@gunnar.cc>
Re: Upload file format checking <spam@nospam.com>
Re: Upload file format checking <1usa@llenroc.ude.invalid>
Re: Upload file format checking (Rick Scott)
Re: Upload file format checking xhoster@gmail.com
Re: Weighing the evidence, Perl is a GUESSING game !! <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 02 Mar 2006 01:25:05 GMT
From: Bryan <spam@nospam.com>
Subject: Upload file format checking
Message-Id: <RPrNf.18135$2O6.14044@newssvr12.news.prodigy.com>
Hi,
What is the best way to validate that an uploaded file (using CGI.pm) is
a tab delimited table of the correct format? I.e. every line has the
same number of columns as the header, and the header has to match a
predefined set of table headers. Should it be done as the file is read
in? After I store it to disk?
Suggestions for implementations?
Thanks,
B
------------------------------
Date: 02 Mar 2006 02:31:53 GMT
From: xhoster@gmail.com
Subject: Re: Upload file format checking
Message-Id: <20060301213545.800$NE@newsreader.com>
Bryan <spam@nospam.com> wrote:
> Hi,
>
> What is the best way to validate that an uploaded file (using CGI.pm) is
> a tab delimited table of the correct format? I.e. every line has the
> same number of columns as the header, and the header has to match a
> predefined set of table headers. Should it be done as the file is read
> in? After I store it to disk?
That depends on what you plan to do about it if the file is not valid,
and what you plan to do with it if it is valid.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Thu, 02 Mar 2006 03:46:48 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Upload file format checking
Message-Id: <46n4knFc1h7pU1@individual.net>
Bryan wrote:
> What is the best way to validate that an uploaded file (using CGI.pm) is
> a tab delimited table of the correct format? I.e. every line has the
> same number of columns as the header, and the header has to match a
> predefined set of table headers. Should it be done as the file is read
> in? After I store it to disk?
I don't understand how you would be able to validate the file before it
has been stored to disk, at least temporarily. So my answer would be:
After you have stored it, and then delete the file if the validation fails.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 02 Mar 2006 02:53:53 GMT
From: Bryan <spam@nospam.com>
Subject: Re: Upload file format checking
Message-Id: <57tNf.55611$dW3.42986@newssvr21.news.prodigy.com>
xhoster@gmail.com wrote:
> Bryan <spam@nospam.com> wrote:
>
>>Hi,
>>
>>What is the best way to validate that an uploaded file (using CGI.pm) is
>>a tab delimited table of the correct format? I.e. every line has the
>>same number of columns as the header, and the header has to match a
>>predefined set of table headers. Should it be done as the file is read
>>in? After I store it to disk?
>
>
> That depends on what you plan to do about it if the file is not valid,
> and what you plan to do with it if it is valid.
>
> Xho
>
Dont really see how that matters as that is another function. Maybe Ill
delete it. Maybe Ill fire a js message, maybe Ill fix it.
But I think a yes or no would be sufficient, a function that returns a 1
or 0.
------------------------------
Date: Thu, 02 Mar 2006 03:04:41 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Upload file format checking
Message-Id: <Xns9779E0B0FA71asu1cornelledu@127.0.0.1>
Bryan <spam@nospam.com> wrote in
news:57tNf.55611$dW3.42986@newssvr21.news.prodigy.com:
> xhoster@gmail.com wrote:
>> Bryan <spam@nospam.com> wrote:
>>
>>>Hi,
>>>
>>>What is the best way to validate that an uploaded file (using CGI.pm)
>>>is a tab delimited table of the correct format? I.e. every line has
>>>the same number of columns as the header, and the header has to match
>>>a predefined set of table headers. Should it be done as the file is
>>>read in? After I store it to disk?
>>
>>
>> That depends on what you plan to do about it if the file is not
>> valid, and what you plan to do with it if it is valid.
>>
>> Xho
>>
>
> Dont really see how that matters as that is another function. Maybe
> Ill delete it. Maybe Ill fire a js message, maybe Ill fix it.
>
> But I think a yes or no would be sufficient, a function that returns a
> 1 or 0.
Are you somehow expecting that someone is going to write that for you?
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Thu, 02 Mar 2006 03:21:04 -0000
From: rick@shadowspar.dyndns.org (Rick Scott)
Subject: Re: Upload file format checking
Message-Id: <1141269415.fe6DF.18028@shadowspar>
(Bryan <spam@nospam.com> uttered:)
> What is the best way to validate that an uploaded file (using
> CGI.pm) is a tab delimited table of the correct format? I.e.
> every line has the same number of columns as the header, and the
> header has to match a predefined set of table headers. Should it
> be done as the file is read in? After I store it to disk?
>
> Suggestions for implementations?
Have you searched CPAN? Does Text::TabFile do most of what you need?
Rick
--
key CF8F8A75 / print C5C1 F87D 5056 D2C0 D5CE D58F 970F 04D1 CF8F 8A75
ADMIRATION, n. Our polite recognition of another's resemblance to
ourselves.
:Ambrose Bierce, "The Devil's Dictionary" (1911)
------------------------------
Date: 02 Mar 2006 03:18:32 GMT
From: xhoster@gmail.com
Subject: Re: Upload file format checking
Message-Id: <20060301222225.175$gT@newsreader.com>
Bryan <spam@nospam.com> wrote:
> xhoster@gmail.com wrote:
> > Bryan <spam@nospam.com> wrote:
> >
> >>Hi,
> >>
> >>What is the best way to validate that an uploaded file (using CGI.pm)
> >>is a tab delimited table of the correct format? I.e. every line has
> >>the same number of columns as the header, and the header has to match a
> >>predefined set of table headers. Should it be done as the file is read
> >>in? After I store it to disk?
> >
> >
> > That depends on what you plan to do about it if the file is not valid,
> > and what you plan to do with it if it is valid.
> >
> > Xho
> >
>
> Dont really see how that matters as that is another function.
If you are only interested in throwing the problem over the wall and then
forgetting about, why ask which way is best? It seems like, at this point,
it is all the same to you.
> Maybe Ill
> delete it.
Well, then I guess you had better save it to disk first. Or else deleting
will be pretty hard.
> Maybe Ill fire a js message, maybe Ill fix it.
I doubt you will be firing off a js message on the server.
>
> But I think a yes or no would be sufficient, a function that returns a 1
> or 0.
If that is sufficient, that what is your question?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Thu, 02 Mar 2006 00:47:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Weighing the evidence, Perl is a GUESSING game !!
Message-Id: <Xns9779C98194212asu1cornelledu@127.0.0.1>
"Lukas Mai" <rwxr-xr-x@gmx.de> wrote in news:du569l$8s9$01$2@news.t-
online.com:
> robic0 schrob:
...
>> I'm writing this because of the recent avalance of bullshit
>> on this subject by Abgail and Sunan and others on a single subject.
...
> You suck at spelling names.
You are not giving him enough credit. ;-)
He sucks at spelling any word.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9009
***************************************