Re: Download images/movies

2004-08-26 Thread Joel Rees
On 2004.8.26, at 04:45 AM, Bill Stephenson wrote: On Aug 25, 2004, at 10:59 AM, Mark Wheeler wrote: Hi Joel, Thanks for your input. In regards to filename, I'm assuming you are talking about the filename passed within the HTML, right? I think what I will probably do is pass an ID number to the sc

Re: Download images/movies

2004-08-25 Thread Joel Rees
Thanks for your input. In regards to filename, I'm assuming you are talking about the filename passed within the HTML, right? If I know what you meant be that, I'd be more able to say. So I'll dodge and try explaining it this way: Any script that could potentially be called by someone typing it

Re: Download images/movies

2004-08-25 Thread Bill Stephenson
On Aug 25, 2004, at 10:59 AM, Mark Wheeler wrote: Hi Joel, Thanks for your input. In regards to filename, I'm assuming you are talking about the filename passed within the HTML, right? I think what I will probably do is pass an ID number to the script and then process it that way. I will still c

Re: Download images/movies

2004-08-25 Thread Bill Stephenson
On Aug 25, 2004, at 10:59 AM, Mark Wheeler wrote: Hi Joel, Thanks for your input. In regards to filename, I'm assuming you are talking about the filename passed within the HTML, right? I think what I will probably do is pass an ID number to the script and then process it that way. I will still c

Re: Download images/movies

2004-08-25 Thread Mark Wheeler
Hi Andy, I'll give it a try and let you know. I just tried the current version of the script (the one that IE Mac has a problem with) on a PC and it works great. So it seems to just be IE Mac. So I'll try the new thing and let you know. Thanks, Mark On Aug 25, 2004, at 5:47 AM, Andrew Mace w

Re: Download images/movies

2004-08-25 Thread Mark Wheeler
Hi Joel, Thanks for your input. In regards to filename, I'm assuming you are talking about the filename passed within the HTML, right? I think what I will probably do is pass an ID number to the script and then process it that way. I will still check for "../" andywhere the passed ID, as we

Re: Download images/movies

2004-08-25 Thread Joel Rees
Just a few nosy comments -- Untitled Page picture link Not sure why you want to bother with javascript in there. ICBW, but I don't think it buys you anything. And some of your family may decide to turn javascript in their browsers off.

Re: Download images/movies

2004-08-25 Thread Pete Prodoehl
Andrew Mace wrote: IE just displays the graphic but doesn't download it. The script does not seem to be overriding whatever the settings are in IE regarding MIME types and what to do with them -- I'm guessing. Is there a way to override that? You could try changing the Content-Type to appli

Re: Download images/movies

2004-08-25 Thread Andrew Mace
IE just displays the graphic but doesn't download it. The script does not seem to be overriding whatever the settings are in IE regarding MIME types and what to do with them -- I'm guessing. Is there a way to override that? You could try changing the Content-Type to application/download. Th

Re: Download images/movies

2004-08-24 Thread Mark Wheeler
Hi Andy, Yup, that was it. I was using a relative path, not abslute. That fixed it. I script now works great in Netscape and Safari, but not in IE. (All on a Mac - I'll check out the PC tomorrow). IE just displays the graphic but doesn't download it. The script does not seem to be overridin

Re: Download images/movies

2004-08-24 Thread Andrew Mace
$path is a system path, right? As in, like, not relative to the webserver? Just making sure... Also, I messed up and used $length in one place and $size in another, though that doesn't explain your troubles. I mean, you could do a lot of things to debug. A quick thing you could do would

Re: Download images/movies

2004-08-24 Thread Mark Wheeler
Hi Chris, I'm not at home (where the server is) so I'll give that a try, too. The drawback on this method would be that I would only be able to use it on a server that I had access to the Apache config file. This works well at home, but not so well with a paid outside hosting service. But I'm g

Re: Download images/movies

2004-08-24 Thread Mark Wheeler
Hi Andy (another andy), I tried your changes, but not go. On a PC, a 0k file is saved. On a Mac, the browser (Safari 1.2.2) gives me a blank screen with nothing d/l or a save dialog box - nothing. Any ideas? Thanks, Mark On Aug 24, 2004, at 4:10 PM, Andy Turner wrote: I would also recommend us

Re: Download images/movies

2004-08-24 Thread Mark Wheeler
Hi Andy, Thanks for the input. I should have check the "read/write" method -- my bad. I tried both the slurp and the read methods, but the same thing still happens. On a PC the save dialog comes up but the file saved is 0k, and on a Mac, the the progress bar is just a spinning barber poll. A

Re: Download images/movies

2004-08-24 Thread Chris Devers
On Tue, 24 Aug 2004, Andy Turner wrote: I would agree that slurping the entire file is a bad idea. This whole project is, in hindsight, a bad idea. This can be done more safely & easily in the Apache config. Assume that the image tree lives in /Library/WebServer/Documents/photos, and is ordinarily

Re: Download images/movies

2004-08-24 Thread Andy Turner
I would also recommend using PATH_INFO instead of a query string. This will more reliably set the filename then the content disposition will. The HTML would be: Untitled Page picture link I would agree that slurping the entire file is a bad idea. However you don't need to use read. You

Re: Download images/movies

2004-08-24 Thread Andrew Mace
Hey Mark - A few things. - You want to open the file for reading, not to write. - You should undef $/ to slurp the file if you're using < > to read. - You should stat the file before opening it to add the Content-Length header, if you want. - For larger files, it would make more sense to use read

Re: Download images/movies

2004-08-24 Thread Mark Wheeler
Hi all, Here is my first attempt to write this script. I will be adding the protection/whitelisting/etc. after I get the basic this running. Here is what I have so far, and here is what happens. On a PC, the dialog box comes up and saves the file, but it is 0K -- nothing in it. On a Mac, th

Re: Download images/movies

2004-08-23 Thread Chris Devers
On Mon, 23 Aug 2004, william ross wrote: On 23 Aug 2004, at 12:14, Chris Devers wrote: On Mon, 23 Aug 2004, william ross wrote: This will mean that jpegs in that directory can't ever be used on pages -- which would kind of ruin the fun. There seems to be an easy workaround though: symlink ~/Sites/

Re: Download images/movies

2004-08-23 Thread william ross
On 23 Aug 2004, at 12:14, Chris Devers wrote: On Mon, 23 Aug 2004, william ross wrote: This will mean that jpegs in that directory can't ever be used on pages -- which would kind of ruin the fun. There seems to be an easy workaround though: symlink ~/Sites/images (or whatever it is) to something

Re: Download images/movies

2004-08-23 Thread william ross
On 23 Aug 2004, at 18:49, Morbus Iff wrote: >Perhaps set the path of the image directory >into the script, hardcoded like so: > > $path = '/home/fubar/www/images'; > >or something like that so you are restricting to a certain directory, >and not just letting any file be read in by the cgi and sen

Re: Download images/movies

2004-08-23 Thread Joel Rees
I think that's what I'm looking for. One question. What do you mean "whitelist" the filepaths". My only reference point is email. "Whitelist" for me means that email address on my "whitelist" always get through, even though the spam software might initially think it's spam. Can you clarify? If

Re: Download images/movies

2004-08-23 Thread Pete Prodoehl
Morbus Iff wrote: >Perhaps set the path of the image directory >into the script, hardcoded like so: > > $path = '/home/fubar/www/images'; > >or something like that so you are restricting to a certain directory, >and not just letting any file be read in by the cgi and sent to the This isn't

Re: Download images/movies

2004-08-23 Thread Morbus Iff
>Perhaps set the path of the image directory >into the script, hardcoded like so: > > $path = '/home/fubar/www/images'; > >or something like that so you are restricting to a certain directory, >and not just letting any file be read in by the cgi and sent to the This isn't safe either. Someone cou

Re: Download images/movies

2004-08-23 Thread Pete Prodoehl
Mark Wheeler wrote: Hi William, I think that's what I'm looking for. One question. What do you mean "whitelist" the filepaths". My only reference point is email. "Whitelist" for me means that email address on my "whitelist" always get through, even though the spam software might initially think

Re: Download images/movies

2004-08-23 Thread Mark Wheeler
Hi Pete, I'll keep that in mind. Gotta love IE... Mark On Aug 23, 2004, at 6:58 AM, Pete Prodoehl wrote: william ross wrote: On 21 Aug 2004, at 20:07, Chris Devers wrote: On Sat, 21 Aug 2004, Mark Wheeler wrote: This is untested, but I'm guessing that you could write a simple CGI script that takes

Re: Download images/movies

2004-08-23 Thread Mark Wheeler
Hi William, I think that's what I'm looking for. One question. What do you mean "whitelist" the filepaths". My only reference point is email. "Whitelist" for me means that email address on my "whitelist" always get through, even though the spam software might initially think it's spam. Can you

Re: Download images/movies

2004-08-23 Thread Pete Prodoehl
william ross wrote: On 21 Aug 2004, at 20:07, Chris Devers wrote: On Sat, 21 Aug 2004, Mark Wheeler wrote: This is untested, but I'm guessing that you could write a simple CGI script that takes the URL for an image as an argument -- maybe just using $ENV{'HTTP_QUERY_STRING'} so that the url can b

Re: Download images/movies

2004-08-23 Thread Chris Devers
On Mon, 23 Aug 2004, william ross wrote: No need. On apache, at least, you can change the mime-type in an .htaccess file. Assuming the AllowOverride settings permit it, which they normally would: AddType application/octet-stream jpg should do it. Ok, that's much more clever than I was th

Re: Download images/movies

2004-08-23 Thread william ross
On 21 Aug 2004, at 20:07, Chris Devers wrote: On Sat, 21 Aug 2004, Mark Wheeler wrote: I have a picture gallery I building for my family. When a movie or picture is displayed, I want them to be able to save it. But... if I just provide a link in the coding to the actual file, it will open up in

Re: Download images/movies

2004-08-21 Thread Mark Wheeler
Thanks. I'll check it out. Mark On Aug 21, 2004, at 4:17 PM, Joel Rees wrote: http://reiisi.homedns.org/~joel/cs/shared_code/showpics.pl.text

Re: Download images/movies

2004-08-21 Thread Joel Rees
Thinking twice, I'll be out of pocket for a while, so I'll just go ahead and post this just in case anyone is interested. http://reiisi.homedns.org/~joel/cs/shared_code/showpics.pl.text Contains some shift-jis, which can be stripped out with no ill effects. -- Joel Rees It's not the "Here

Re: Download images/movies

2004-08-21 Thread Joel Rees
On 2004.8.22, at 04:07 AM, Chris Devers wrote: On Sat, 21 Aug 2004, Mark Wheeler wrote: I have a picture gallery I building for my family. When a movie or picture is displayed, I want them to be able to save it. But... if I just provide a link in the coding to the actual file, it will open up in

Re: Download images/movies

2004-08-21 Thread Mark Wheeler
Hi Bill, That's pretty much what Chris said, too. I'll give it a try and let you know. On Aug 21, 2004, at 11:27 AM, Bill Stephenson wrote: Hey Mark, I sympathize with you, it should be easy to ask them just to "right click", or "control click" but most of my family just doesn't grasp the conce

Re: Download images/movies

2004-08-21 Thread Mark Wheeler
Hi Chris, That makes sense. I'll give it a try and let you know. Thanks, Mark On Aug 21, 2004, at 12:07 PM, Chris Devers wrote: On Sat, 21 Aug 2004, Mark Wheeler wrote: I have a picture gallery I building for my family. When a movie or picture is displayed, I want them to be able to save it. But..

Re: Download images/movies

2004-08-21 Thread Chris Devers
On Sat, 21 Aug 2004, Mark Wheeler wrote: I have a picture gallery I building for my family. When a movie or picture is displayed, I want them to be able to save it. But... if I just provide a link in the coding to the actual file, it will open up in the browser window and be displayed. Is there

Re: Download images/movies

2004-08-21 Thread Bill Stephenson
Hey Mark, I sympathize with you, it should be easy to ask them just to "right click", or "control click" but most of my family just doesn't grasp the concept any better than I do the GameCube keypad commands my son tells me to use when he's whupping me on a Football game. I think if you filter

Download images/movies

2004-08-21 Thread Mark Wheeler
Hi, I have a picture gallery I building for my family. When a movie or picture is displayed, I want them to be able to save it. But... if I just provide a link in the coding to the actual file, it will open up in the browser window and be displayed. Is there a way to have download, either autom