Re: How to browse and select a remote file and then return the filename

2005-07-07 Thread Bill Stephenson


On Jul 7, 2005, at 9:00 AM, Neville Hodder wrote:

I am in the process of learning how to use the CGI.pm module but can 
not

find a method that will allow me to simply choose a 'remote' file. I
need to be able to return the value "path+filename" of a file that the
user has browsed to using something like the standard HTML form type:



I do NOT want to upload a file using $query->filefield, instead I want
the user to be able to select a file using the standard browse dialogue
and then the CGI script return that selected filename for further use.

Thanks
Nev


You can use Firefox for the client... It will send the name and path of 
the file, but won't upload it ;)


And, while not positive, I think you can do this with CGI.pm. Try 
setting the max upload to 1 or 2 k and see what happens. Use 
"File::Basename" to get the name and path of the remote file.


Kindest Regards,

--
Bill Stephenson
417-546-8390


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to browse and select a remote file and then return the filename

2005-07-07 Thread David Dorward
On Thu, Jul 07, 2005 at 12:14:42PM -0400, Chris Devers wrote:

> > Well, that specific example anyway :) I suspect a signed Java applet
> > could work on other systems.
 
> I thought Java applets were sandboxed, and that access to the filesystem 
> was explicitly not allowed. Have things changed in the past few years? I 
> thought the whole point of Java applets was that they were "safe", in 
> part, because they couldn't interact with the underlying filesystem. 

That's true for standard applets, but I *think* that a digital
signature and the user granting permission will let them escape the
sandbox. I wouldn't swear to it, I've done very little with applets.

-- 
David Dorward  http://dorward.me.uk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to browse and select a remote file and then return the filename

2005-07-07 Thread Chris Devers
On Thu, 7 Jul 2005, David Dorward wrote:

> On Thu, Jul 07, 2005 at 11:42:29AM -0400, Chris Devers wrote:
> 
> > > It isn't possible. For that sort of thing you'll need something like
> > > an ActiveX control with permission to read the user's file system. (Or
> > > to get the user to type the path to the file).
> > 
> > And that, in turn, can only be reliable with IE on Windows.
> 
> Well, that specific example anyway :) I suspect a signed Java applet
> could work on other systems.

I thought Java applets were sandboxed, and that access to the filesystem 
was explicitly not allowed. Have things changed in the past few years? I 
thought the whole point of Java applets was that they were "safe", in 
part, because they couldn't interact with the underlying filesystem. 

> I seem to recall somebody managing to run ActiveX and IE under WINE :)

That barely counts :-)

 

-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: How to browse and select a remote file and then return the filename

2005-07-07 Thread Hellman, Matthew
Do you mean you just don't want the actual file uploaded...just the name
of it?  You can probably accomplish this by having the file form field
in a separate form (that is not submitted).  Then use javascript to
populate the field in the form that actually does get submitted.

-Original Message-
From: Neville Hodder [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 07, 2005 9:00 AM
To: beginners-cgi@perl.org
Subject: How to browse and select a remote file and then return the
filename

I am in the process of learning how to use the CGI.pm module but can not
find a method that will allow me to simply choose a 'remote' file. I
need to be able to return the value "path+filename" of a file that the
user has browsed to using something like the standard HTML form type:
 

 
I do NOT want to upload a file using $query->filefield, instead I want
the user to be able to select a file using the standard browse dialogue
and then the CGI script return that selected filename for further use. 
 
Thanks
Nev


-Message Disclaimer-

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to [EMAIL PROTECTED] and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to browse and select a remote file and then return the filename

2005-07-07 Thread David Dorward
On Thu, Jul 07, 2005 at 11:42:29AM -0400, Chris Devers wrote:

> > It isn't possible. For that sort of thing you'll need something like
> > an ActiveX control with permission to read the user's file system. (Or
> > to get the user to type the path to the file).
> 
> And that, in turn, can only be reliable with IE on Windows.

Well, that specific example anyway :) I suspect a signed Java applet
could work on other systems. Its not reliable on IE anyway - its
unlikely that all users would have their security low enough (and
accept the alerts) for it to run.

However, I have trouble conceiving of a circumstance where it would be
useful to do this over the WWW, so its probably in an environment where
user agents can be mandated.
 
> I'm not aware of anyone getting ActiveX to work on anything other than 
> the IE/Windows combination. Admittedly, that's something like 90% of web 
> users, but Firefox, in particular, seems to be growing fast now.

I seem to recall somebody managing to run ActiveX and IE under WINE :)
 
-- 
David Dorward  http://dorward.me.uk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to browse and select a remote file and then return the filename

2005-07-07 Thread Chris Devers
On Thu, 7 Jul 2005, David Dorward wrote:

> On Thu, Jul 07, 2005 at 03:00:02PM +0100, Neville Hodder wrote:
> > I am in the process of learning how to use the CGI.pm module but can not
> > find a method that will allow me to simply choose a 'remote' file. I
> > need to be able to return the value "path+filename" of a file that the
> > user has browsed to using something like the standard HTML form type:
> 
> It isn't possible. For that sort of thing you'll need something like
> an ActiveX control with permission to read the user's file system. (Or
> to get the user to type the path to the file).

And that, in turn, can only be reliable with IE on Windows. It does 
nothing for the growing minority that uses alternative browsers 
(Firefox, Opera, Safari, etc) or operating systems (OSX, Linux, etc); 
I'm not aware of anyone getting ActiveX to work on anything other than 
the IE/Windows combination. Admittedly, that's something like 90% of web 
users, but Firefox, in particular, seems to be growing fast now.

Out of curiosity, why do you need to do this? What problem are you 
trying to solve ? Could you get the result you need by some way other 
than figuring out remote file paths ?
 

-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to browse and select a remote file and then return the filename

2005-07-07 Thread David Dorward
On Thu, Jul 07, 2005 at 03:00:02PM +0100, Neville Hodder wrote:
> I am in the process of learning how to use the CGI.pm module but can not
> find a method that will allow me to simply choose a 'remote' file. I
> need to be able to return the value "path+filename" of a file that the
> user has browsed to using something like the standard HTML form type:

It isn't possible. For that sort of thing you'll need something like
an ActiveX control with permission to read the user's file system. (Or
to get the user to type the path to the file).

Since the server doesn't have permission to access the user's file
system over the Internet, and since that file system might be UNIX
type, DOC type, or some other unknown type - it isn't a particularly
useful feature to build into HTML.

-- 
David Dorward  http://dorward.me.uk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




How to browse and select a remote file and then return the filename

2005-07-07 Thread Neville Hodder
I am in the process of learning how to use the CGI.pm module but can not
find a method that will allow me to simply choose a 'remote' file. I
need to be able to return the value "path+filename" of a file that the
user has browsed to using something like the standard HTML form type:
 

 
I do NOT want to upload a file using $query->filefield, instead I want
the user to be able to select a file using the standard browse dialogue
and then the CGI script return that selected filename for further use. 
 
Thanks
Nev