|
From: kimanhtle on 23 Apr 2008 10:23 On Apr 23, 9:27 am, Ted Zlatanov <t...(a)lifelogs.com> wrote: > On Wed, 23 Apr 2008 05:19:39 -0700 (PDT) kimanh...(a)gmail.com wrote: > > k> I am at a dead end. I was trying to use the file upload field to have > k> user select a file then use javascript to get the directory name of > k> that file. This directory name was passed to a CGI script which I > k> thought I could use to traverse the directory listing recursively. > k> Then the CGI script would upload all the files in this directory. > k> However, now I am stuck at finding a way to recursively read a > k> directory on my local PC. > > Unfortunately the currently available standards only let you upload one > file at a time. On the client, make a ZIP (or other format) archive of > the whole directory tree of interest and upload that. On the server, > open and examine the archive with Archive::Zip or whatever module is > appropriate for the archive format you've chosen. > > Ted Thank you all so much for your help. Ben, you are right, I did think of the security issue. But my boss kept telling me there was a way to do recursive find. I searched the web and found I could use an applet and then a perl script in the backend. However, boss did not approve using applet. Ted, the zip method was my last resort which I have working.
From: Peter J. Holzer on 23 Apr 2008 13:01 On 2008-04-23 12:31, Ben Bullock <benkasminbullock(a)gmail.com> wrote: > On Wed, 23 Apr 2008 05:19:39 -0700, kimanhtle wrote: >> I am at a dead end. I was trying to use the file upload field to have >> user select a file then use javascript to get the directory name of that >> file. This directory name was passed to a CGI script which I thought I >> could use to traverse the directory listing recursively. Then the CGI >> script would upload all the files in this directory. However, now I am >> stuck at finding a way to recursively read a directory on my local PC. > > There isn't any way for the Unix server to read the directory on your > local PC solely via a web browser, at least unless you totally disable > all security in the browser or something. Imagine if it was possible to > do things like that, we'd all be in serious trouble! You can send the > string containing the directory to the Unix server, but unless the Unix > server has some file system type of connection to your local PC (that is > the "SMB? NFS? FTP? SSH?" stuff which JK mentioned), it's not possible > to look at the PC's file system with either a CGI script or JavaScript. I think it is possible to give signed JavaScript the permission to do this (similar to signed applets). But I've never looked at the details and it's off-topic in this group anyway. hp
From: A. Sinan Unur on 23 Apr 2008 19:45 "Peter J. Holzer" <hjp-usenet2(a)hjp.at> wrote in news:slrng0uqri.5jo.hjp-usenet2(a)hrunkner.hjp.at: > On 2008-04-23 12:31, Ben Bullock <benkasminbullock(a)gmail.com> wrote: .... >> unless the Unix server has some file system type of connection to >> your local PC (that is the "SMB? NFS? FTP? SSH?" stuff which JK >> mentioned), it's not possible to look at the PC's file system with >> either a CGI script or JavaScript. > > I think it is possible to give signed JavaScript the permission to do > this (similar to signed applets). But I've never looked at the details > and it's off-topic in this group anyway. AFAIK, works only on Firefox. So, if that is a suitable restriction for the OP, the next place to check is Firefox documentation on how to do it. Sinan -- A. Sinan Unur <1usa(a)llenroc.ude.invalid> (remove .invalid and reverse each component for email address) comp.lang.perl.misc guidelines on the WWW: http://www.rehabitation.com/clpmisc/
First
|
Prev
|
Pages: 1 2 3 Prev: pop langs website ranking Next: FAQ 1.16 How can I convince others to use Perl? |