|
-
January 12th, 2003, 09:55 PM
#1
Junior Member
Perl question - Saving files from my page
This is what I want to do... I want to allow someone to save a file (in my case an image) from my webpage... They are stored in a directory (http://www.mysite.com/mypictures/)... Is it possible with a perl script to save pic1.jpg in the mypictures directory to a local hard drive? If so how would I go about doing it?
Thanks!
-
January 12th, 2003, 11:53 PM
#2
Junior Member
I have figured out how to connect to the website, now I just dont know how to download the file... Any suggestions would be GREAT! Thanks!
-
January 13th, 2003, 12:23 AM
#3
I'm afraid I'm going to need a bit more clarification. You have a website, and you want to write a perl script to save the images from your website to your harddrive. Any reason you can't just use right-click on the mouse?
Or are you trying to create a webpage that pulls images off another website? Like a webpage that pulls comics off of various pages? I have several of those.
Just a little clarification, please!
/* You are not expected to understand this. */
-
January 13th, 2003, 12:43 AM
#4
Forgive me if I understand you incorrectly... You want to have a script save files *from* your web site *to* a machine's local drive?
I'm afraid this cannot be done. For obvious security reasons, web browsers strictly forbid this kind of thing. Perl CGI scripts (like any other CGI programs) run on the server-side, and hence are not able to access the local drives of machines.
Javascript and other client-side stuff runs locally but has very strict rules about what it's not allowed to do. Saving files locally is one of them.
Of course if you want to run a stand-alone perl program, that could load an image from the web and save it locally very easily, however:
1. They would need to have perl installed for it to work and
2. They would need the same level of trust to trust a perl script running locally as an .exe that you had created, so most people are not going to want to run the script (even if they are able to)
-
January 13th, 2003, 12:46 AM
#5
Junior Member
Basically I want to be able to save images from my website to my hard drive... I could right click on the files but that doesnt involve perl... I want to use perl to do it... It helps me understand sockets and copying files using perl... thanks!
-
January 13th, 2003, 02:05 AM
#6
Junior Member
Hmmm... I think I am confused...
Is it possible to run a perl script from my local machine that will download the file http://www.weburl.com/images/pic1.jpg located on another machine?
doing the same thing as rightclicking on the image pic1.jpg and selecting save as?
Thanks!
-
January 13th, 2003, 03:27 AM
#7
Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|