For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > August 2005 > reading a client file









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 reading a client file
Adriano Allora

2005-08-24, 6:55 pm

hi to all,

I need to read a file selected by (and stored in the computer of) users.

My first idea was on uploaded files:

(all variables are sent correctly;
$_ is the name of the file
$file is a relative pathname)

s/.*[\/\\](.*)/$1/;
$file = "upnull/".$_;
open(LOCALE, "> $file") or die("problema: $!");
binmode LOCALE;
while(<$file> )
{
print LOCALE;
}
close(LOCALE);


I'm curious to know why that script doesn't work and I need to know if
there's a more sicure way to do it (for instance reading the file
without copying it on the server...)

thank you all,

alladr


|^|_|^|_|^| |^|_|^|_|^|
| | | |
| | | |
| |*\_/*\_/*\_/*\_/*\_/* | |
| |
| |
| |
| http://www.e-allora.net |
| |
| |
**************************************

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com