Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
howard
Hangin' Around


Joined: Aug 23, 2006
Posts: 32

PostPosted: Tue Dec 19, 2006 12:11 am Reply with quote

Anybody know how I could force my users to save a file to their desktop instead of opening it in the browser? I'm specifically referring to pdf documents. Thoughts?

Below is an example of the code I'm using

Code:
<tr>

                  <td width="25%"><div align="center">May/June</div></td>
                  <td width="50%"><div align="center">Passing of a Friend <br>Veteran's Day 2005<br>OHA Board of Director Election<br>Unit News </div></td>
                  <td width="25%"><div align="center"><a href="/modules/Chronicles/pdfs/2006/mayjune06.pdf">LINK</a></div></td>
               </tr>


Thanks
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Tue Dec 19, 2006 4:45 am Reply with quote

Quote:
force my users to save a file to their desktop

Huh?...
with any file offered the person can choose where to safe it.....
im sure you know that...
so what do you mean ?
 
View user's profile Send private message
geoff_bell
Hangin' Around


Joined: Dec 07, 2006
Posts: 41

PostPosted: Tue Dec 19, 2006 5:38 am Reply with quote

i think howard is referring to the way some documents that the webmaster would prefer visitors to download will open within the web-browser (ie pdf, doc, xls, etc) instead of offering the person the option to "save as".

i don't think i ever came across it myself. i normally just marked the downloads section that the users has to right-click the link and "save as" themselves.

i remember in particular having difficulty with visitors and a download i had that was a jpg. they clicke dthe link and it opened in the browser window and rescaled to fit. i ended up saving it as a pdf, which was alright at the time as acrobat may not have been able to open docs from within the browser enviroment at the time.
 
View user's profile Send private message
hitwalker
PostPosted: Tue Dec 19, 2006 5:45 am Reply with quote

well all of the above only works if the right software is asigned to that file,meaning that its the standard software to open it with...
but preventing the safe as....that would be hard....never realy saw that...
but we also dont know what file / extension he's talking about.
 
howard
PostPosted: Tue Dec 19, 2006 6:46 am Reply with quote

The file I'm referring to is a pdf file, and I don't want to prevent save as, I want to prevent users from opening the acrobat file in their browser.

If I can't do it, thats fine...I was just wondering if anybody knew a way that would make them download it when they click the link.
 
manunkind
Client


Joined: Apr 26, 2004
Posts: 368
Location: Albuquerque, NM

PostPosted: Tue Dec 19, 2006 6:50 am Reply with quote

This is an Operating System function on the client's PC. No amount of PHP or HTML will change that.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
hitwalker
PostPosted: Tue Dec 19, 2006 6:51 am Reply with quote

ah i see...
yes there is such a javascript piece...
its a bit old and i saw that on a mp3 site a few years ago...
the intention was that people had to save as instead of clicking the link...
that worked cause you were forced to use ...save as...
(edit...eh manunkind....it is possible.. Smile )
 
manunkind
PostPosted: Tue Dec 19, 2006 7:01 am Reply with quote

Javascript and ActiveX were excluded from my statement. Wink

Just keep in mind that more and more people are running without scripting turned on. Client side scripting solutions may be less effective than you think.
 
hitwalker
PostPosted: Tue Dec 19, 2006 7:22 am Reply with quote

well im talking about a few years ago...then it was more standard like that people had java enabled in most cases.
then its no big deal making a script that instructs a computer that you cant click but have to right click to save as instead.
these scripts were similar to the no right click...
how this all would work 5,6 years later i dont know....
 
manunkind
PostPosted: Tue Dec 19, 2006 8:17 am Reply with quote

Very true. I guess the effectiveness of something like this would depend on the application of it. For example, I can't remember the username off the top of my head, but there's a member of the boards here who runs a site solely for his family to keep connected. In that case, it would be very trivial to have those users add his site to their Trusted Sites list if they were running IE in "safe mode", or have them allow all scripting for the site if they run Firefox with the NoScript plug-in.

In any event, all scripting like this should have some kind of fallback option for users without scripting turned on. In which case, it defeats the whole purpose of a "functionality limiting" script anyway. Cosmetic eye candy is one thing, but functionality is like a bit....it's either on or off. Smile
 
howard
PostPosted: Tue Dec 19, 2006 3:33 pm Reply with quote

yeah, I was just wondering if there was an easy way to do it. Evidently there isnt. My client base is going to be a wide variety of users, young to old with a variety of computer experience....so functionality is key.

I'll just put a little note to right click > save as instead of clicking the link.
 
hitwalker
PostPosted: Tue Dec 19, 2006 3:34 pm Reply with quote

ill try to see if i can find that code....
if so ill post again..
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©