Force download

Hi!
I want to know how to "force" the downloads. I mean that if the user can open the file, the file doesn't opens and give the choice to the user to download it.
For example, if the user have installed "adobe reader" in his computer and wants to download a pdf file, the file doesn't open in the browser and give the option to download.
How I can do it?
PD: I have Dreamweaver CS4.

You can Zip the file and in most cases this will work.
Yourfile.pdf becomes YourFile.zip.
Or, do a Google search for Force Download script in the programming language your server supports.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media  Specialists
http://alt-web.com/
http://twitter.com/altweb
http://alt-web.blogspot.com

Similar Messages

  • I wish to upload a PDF file to my website but Firefox 3.6.12 reports it as type application/force-download and NOT application/pdf, WHY?

    My website has been running for many months, and as part of the site users can upload PDF documents to share with others. The last successful upload was 5th Nov, but to-day my upload was rejected because Firefox returned the document type as application/force-download rather than application/pdf. Uploads work fine with IE8.
    The site uses PHP to check extension and document type and, as I mentioned, has worked fine for many months. I have even attempted to upload the same document that succeeded on the 5th, but again Firefox returns application/force-download as the document type.
    Why the change?

    Just found a solution.
    In Tools, Options, Application Firefox listed TWO options against Adobe Acrobat Documents; the apprliaction/pdf and application/force-download. I have deleted mimeTypes.rdf and allowed Firefox to re-create the file. All works as it should now!

  • Force download of JPEG

    Hi,
    My servlet creates a JFreeChart with the writeChartAsJPEG function. The chart itself is created properly.
    I would like to allow the user to open or save the file via a dialog box, but IE recognises the file type and displays the chart in the browser.
    I have been searching the Internet for ages now and haven't found a solution to my problem.
    Do you have a solution to open the dialog box instead of displaying the chart in the browser?
    My code is the following:
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    try {
    response.reset();
    ChartUtilities.writeChartAsJPEG(response.getOutputStream(), getChart(request), 500, 300);
    response.setContentType("application/force-download");
    response.setHeader("content-disposition","inline; filename=Injury_Data.jpg");
    } catch (Exception e) {e.printStackTrace();}
    I have tried, without any success, the following actions:
    - Replace "inline" per "attachment"
    - Replace ".jpg" per ".zzz" or deleting extension
    - Add response.setHeader("pragma","public")
    - All sorts of MIME type: "image/jpeg", "application/unknown", "application/stream", "application/octet-stream", etc...
    The problem is urgent now and i don't have any more leads to try and find a solution. Do you have any idea?
    Thanks,
    Christelle

    I am doing something similar and mine works... Try setting the response headers before outputting the image. The only other differences I see are capitilization (Content-Disposition), and using quotes (") around the filename.

  • Exe file not working with forced download script.

    I have a captivate file that I exported as an exe file for
    pc. It works fine when I download it from the server using the
    direct URL to the file but I don;t want people to actually see
    where it is located so I have a used a force-download php script.
    When I download it by way of the script... it downloads, but the
    file won't play. All I get is a DOS window pop up and then goes
    away. Same file...any ideas?
    The php file I'm using to force the download is below...
    <?php
    $filename = $_GET['file'];
    // required for IE, otherwise Content-disposition is ignored
    if(ini_get('zlib.output_compression'))
    ini_set('zlib.output_compression', 'Off');
    // addition by Jorg Weske
    $file_extension =
    strtolower(substr(strrchr($filename,"."),1));
    if( $filename == "" )
    echo "<html><title>Download
    Error</title><body>ERROR: download file NOT SPECIFIED.
    USE force-download.php?file=filepath</body></html>";
    exit;
    } elseif ( ! file_exists( $filename ) )
    echo "<html><title>Download
    Error</title><body>ERROR: File not found. USE
    force-download.php?file=filepath</body></html>";
    exit;
    switch( $file_extension )
    case "pdf": $ctype="application/pdf"; break;
    case "exe": $ctype="application/octet-stream"; break;
    case "zip": $ctype="application/x-compressed"; break;
    case "swf": $ctype="application/x-shockwave-flash"; break;
    case "doc": $ctype="application/msword"; break;
    case "xls": $ctype="application/vnd.ms-excel"; break;
    case "ppt": $ctype="application/vnd.ms-powerpoint"; break;
    case "gif": $ctype="image/gif"; break;
    case "png": $ctype="image/png"; break;
    case "jpeg":
    case "jpg": $ctype="image/jpg"; break;
    default: $ctype="application/force-download";
    header("Pragma: public"); // required
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0,
    pre-check=0");
    header("Cache-Control: private",false); // required for
    certain browsers
    header("Content-Type: $ctype");
    // change, added quotes to allow spaces in filenames, by
    Rajkumar Singh
    header("Content-Disposition: attachment;
    filename=\"".basename($filename)."\";" );
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: ".filesize($filename));
    readfile("$filename");
    exit();
    ?>

    Actually...never mind. This script creates a HUGE security
    risk....

  • Has anyone maxed out their storage since iOS 7 update forces download of all email?

    Has anyone maxed out their storage since iOS 7 update forces download of all email? I'm on my way to that end. I will have to delete my email accounts. Apple told me to do so and just use the providers' apps instead of iPhone accounts. This pretty much renders my smartphone useless. Not to mention I no longer like using my phone since this awful update. Not as intuitive or fun!

    (A) Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    (B) Make sure sound is not muted in Control Center; tap on the little bell. Swipe upwards from bottom of screen to launch Control Center

  • Force downloading mysite HD photos from Exchange 2013

    Hi Sharepoint Admins,
    I want to force download all HD photos from Exchange 2013 into users mysite profiles. I already provisioned all user mysites by powershell. HD photos are also available, but every user has to open his own mysite by himself to trigger the picture download.
    The goal is to download photos without having every user to logon on their site.
    Is there any way to force this?
    "SharePoint Server 2013 requests photos from Exchange 2013 automatically when a user performs an operation that causes a request for their own photo (for example, browsing to their own user profile page). That means that the user needs to have requested
    his/her own photo, before other users will be able to see it."
    Best Regards
    Markus Kühn

    Hi Markus,
    I understand you would like to manually sync HD photo from Exchange 2013 to SharePoint 2013 mysite.
    Since "SharePoint Server 2013 requests photos from Exchange 2013 automatically when a user performs an operation that causes a request for their own photo (for example, browsing to their own user profile page)", you need to browse all
    sites in Mysite web application.
    To do this, you may refer SharePoint warmup script and make the script to work for you MySite web application. Just run the warmup script, all mysites can be browsed once.
    https://gallery.technet.microsoft.com/office/SharePoint-2007-2010-or-d1884b4b
    https://spbestwarmup.codeplex.com/
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Force Download PDF code - getting "could not open" error

    Hello I am having some trouble with some "force download" code. I have spent many days on google looking for a good tutorial / script but there appears to be issues with everyone of them that I try.
    I came across a simple one that I got sort-of working, however the PDFs that it downloads error for some reason. The PDF when trying to open (in adobe reader) produces the following error:
    Could not open '3GLG534WW.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
    My website with an example download link is: http://www.reese-test2.co.uk/3GLG534WWc.php - click on the green button on the download tab
    Does anyone know what I need to alter to get it to work? code below on my script (downloadSPECS.php) and underneath that the code on the actual link to the PDF
    The script code (downloadSPECS.php) :
    <?php
    $pdf = substr($_SERVER['PATH_INFO'], 1);
    if(preg_match('/^[a-zA-Z0-9_\-]+.pdf$/', $pdf) == 0) {
      print "Illegal name: $pdf";
      return;
    header('Content-type: application/pdf');
    header('Content-disposition: attachment; filename=' . $pdf);
    readfile('http://www.reese-test2.co.uk/Downloads/Specs' . $pdf);
    ?>
    The code on the green button / PDF link:
                  <p><a href="http://www.reese-test2.co.uk/scripts/downloadSPECS.php/3GLG534WW.pdf" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('SpecDL','','images/specDLB.jpg',1)"><img src="images/specDL.jpg" alt="Download Spec Sheet" width="196" height="71" id="SpecDL" /></a></p>
                  <p> </p>

    Hi thanks all for your answers.
    The PDF is def ok. you can see it fine when you put the PDFs address in the browser:
    http://www.reese-test2.co.uk/Downloads/Specs/3GLG534WW.pdf
    I changed the 1 to a 0 but got a "illegal name" error
    I have tried a few other things like adding the extra parts to the script (see code below - ob_clean and flush): Still not working though!
    I have tried changing the readfile location - adding public_html and tried a few other things, but cant make it work! Could there be a file size problem maybe? is there a code to allow for this?
    thanks
    Sara
    <?php
    $pdf = substr($_SERVER['PATH_INFO'], 1);
    if(preg_match('/^[a-zA-Z0-9_\-]+.pdf$/', $pdf) == 0) {
      print "Illegal name: $pdf";
      return;
    header("Cache-Control:  maxage=1");
    header("Pragma: public");
    header('Content-type: application/pdf');
    header('Content-disposition: attachment; filename=' . $pdf);
    readfile('http://www.reese-test2.co.uk/public_html/Downloads/Specs' . $pdf);
    ob_clean();
    flush();
    readfile($file);
    ?>

  • Force download video in stead of using the cache ?

    Hello,
    Does anyone has expierence with the fact that when you
    connect to an flv file to play video in flash
    the first time it will download the flv file. But suppose i
    change the content of the flv file but keep the name the same it
    will play the previous video because it's using the cache of
    IExplorer.
    Is there a way to force the download? Or a way when the movie
    is finished to clear that cached movie?
    I also tried to unload the movie, but that doesn't do the
    trick.
    If someone has a fix for this, please let me know.

    Hello Michael,
    > I am still very new action scripting, so please bear
    with me when I
    > ask newbie questions.
    >
    > Dave, would that also apply to loading other files, such
    as text?
    > My current action reads thus:
    > loadVariablesNum("news.txt", 0);
    > stop();
    > As with the OP, this is loaded into the cache and isn't
    always
    > updated when the visitor returns to the site.
    >
    > Would this be an appropriate revision to the code?
    >
    > loadVariablesNum("news.txt?r=", 0) + getTimer();
    > stop();
    loadVariablesNum("news.txt?r="+ getTimer(), 0) ;
    stop();
    btw. it's absolutely unnecessary to add hash as a parameter.
    you can just
    ad it right after "?" symbol.
    Hash purpose is to make your URL unique to browser. Also, if
    you *** this
    hash as a parameter in a URL-encoded string - you pass this
    parameter to
    flash (if dealing with links to flash files) and it's OK if
    you use it further,
    but do you need additional garbage if not? )

  • ITunes Match forces download from iCloud when iPhone is attached to my Mac?

    I got iTunes Match just before christmas and I, like a lot of people have been having trouble with the artwork. So I decided to reset my iPhone to wipe all the music off...everything is backed up and I've done this before and it's fixed problems.
    My phone is physically attached to my Mac and I go to sync my playlists and I face a screen saying "iPhone can access music in iCloud. Songs can be downloaded and played via wifi" Why am I forced to download off iCloud when it HAS to be easier to sync off my Mac?
    The phone point of getting iTunes Match was to add to my music listening experience not to take away from it. Now I have to manually add songs and playlists when before it was just selecting a few tick-boxes and saying sync. Why am I paying for this service?

    83years wrote:
    Why am I paying for this service?
    I assume because you signed up for it.
    I'd leave feedback with Apple, as this is a user to user forum so they will not necessary see your comments.
    There is a way round adding lots of music onto your phone by USB. I haven't done it personally, so you may want to do a search on here, but I believe that basically you turn off Match on your phone, sync as previously and then turn it back on.
    As I say, I haven't tried it myself, so best do a quick check first.

  • Force downloads/kill streaming in Podcasts app?

    I need to know that my podcasts are downloaded and available when I am not connected to the internet.
    With iOS7 and the new podcasts app, is there any way to FORCE them to download and not ever try to stream?  I listen to sometimes dozens of podcasts a day as a continuous play list, and tapping each one to download is really not a reasonable approach--like when you're in the car driving several hundred miles at a time, it's not safe to be clicking next, next, next to get to a podcast in the list that might have actually been downloaded to the device. 
    It was easy with iOS 6--download podcasts to computer when conveniently situated for wifi, sync to iOS device at leisure, listen offline....

    Also would appreciate suggestions for a 3rd party podcast app that can be set to only download can sync what's been played to podcasts on the computer--I need the capacity to listen from either device. 

  • Force download of file on mac?

    I have some inDesign files that are posted on a site. I have
    created links
    to them but with the mac, it wants to just open them in the
    browser; it
    doesn't just download them .
    How do I force a download?
    Lee Arthur Fairbanks
    American Educational Products LLC
    Web Designer/Developer
    Voice - 715.723.4427 x132
    Fax - 715.723.8021
    Hubbard Scientific
    1120 Halbleib Road
    P.O. Box 760
    Chippewa Falls, Wisconsin 54729
    www.shnta.com
    [email protected]

    David:
    There is no way to create a domain file from the published files. You will have to recreate the site from scratch. You can use, however, the image files that were uploaded for the site so you don't need to go rummaging around trying to find the originals.
    The older version would probably be a better option than starting from scratch. You can compare what you see in Safari against iWeb and then use the files that were created for the site to add to what you have in iWeb.
    In the future I suggest you make another copy of the newest version of the domain file as you exit iWeb on each location. You can modify varkgirl's Automator application to backup the Domain.sites file to back it up from the Flash drive to a folder on each location before ejecting the flash drive. You can get it here: http://www.varkgirl.com/Varkgirl/iWeb%20Tips.html
    Do you Twango?

  • Why is Adobe forcing downloads of Chrome and Google Toolbar?

    Before someone states there is an option, I was given absolutely no option to decide to accept Google Chrome or Google Toolbar. I am forced to use Adobe reader from a Pearson
    because of classes. I go to the download link, click run. And there you go, Adobe downloads Adobe Reader, Google Tool Bar, and Google Chrome.
    I do NOT want this crap on my computer.
    Now I have to go uninstall this. If I wanted Google Chrome or ANY toolbar I would download it myself. Forcing anyone to download software with no option is a stupif PR move.
    Its only going to make people angry.

    If you download Adobe Reader from http://get.adobe.com/reader/ there is a checkbox to remove optional software from the download.
    If you download Adobe Reader from http://get.adobe.com/reader/enterprise/ there is no bundled software with it.
    Lots of companies offer bundled software with free products; it is usually your choice to refuse the offered 3rd party software.

  • Force download of Office document in a manner that works for anonymous users.

    Hello,
    We have SharePoint 2013 with Office Web Apps server.  A large portion of our site is accessible by the public.  In a couple of places, we have Word documents linked, and we would like the behavior in these spot instances to be to download the file
    (i.e., give a "Save As" dialog), rather than to try to open them from the server (resulting in a login challenge).
    I'm aware that some use download.aspx in the layouts folder to achieve this, but that doesn't work anonymously.  Any other ideas?  Bonus points for anything that can be maintained easily by my user base (though not required).

    If possible you can use HTML5 'download' attribute, this will open the 'Save As' dialog regardless of file type without taking
    you away from the page.
    <a href="/document/path" download>Click here to download</a>
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • Making mp3 and or file type force download

    I have a a web app that has a sermon and also has a notes you can down load. But I want it so when you click download it opens a save as box or open not stream. How can I use the literature settings to accomplish this in my web app.
    Shaun Ryan

    Mario,
    Once again thank you for your help. However the {tag_sermon_value} does not seem to do anything or be recognized as a tag. Now it just shows {tag_sermon_value} on the right side of the sermons section. Is what I am asking not very clear? What we are doing is offering different ways to listen and or get the sermons. 1) they can stream it using the player on the left. 2) They can subscribe to the podcast.(not currently setup yet). 3) They can download the mp3 (where my problem is) I know you can always right click and save target link. However I was trying to make it a lot easier so all you have to do is click on it. Like the functionallity of the Media Downloads module. Please let me know if I am not making any sense. And once again thank you very much for your time.
    Shaun Ryan

  • Netscape Browser Forcing Download Prompt with .jsp

    My apologies in advance if this topic has already been covered. Here is the behavior I've come across and can't resolve:
    When a user with an IE browser visits my site (i.e. http://www.mysite.com), the default page is loaded - no problems. With Netscape, the user is prompted to download. However, if the Netscape user types the full path to the default file (i.e. http://www.mysite.com/index_new.jsp) there is no problem.
    This would lead me to think there is a problem with my deployment - but I can't solve it.
    I'm using Tomcat 3.2.1 with the isapi filter. In the server.xml, I've set up a context to my server's root:
    <Context path="/"
    docBase="d:\root"
    crossContext="true"
    debug="0"
    reloadable="true"
    trusted="false" >
    </Context>
    In my web.xml file in d:\root\web-inf I've defined a <welcome-file>. Under IIS I also have a default page for the web root.
    Does anyone have any ideas?
    Thanks - David

    Sorry, to clarify the default file is index_new.jsp - the underscore was lost when it was underlined.
    David

Maybe you are looking for

  • How to include portlet in .menu

    HI, I want to include portlet in .menu means i need to include that portlet to the jsp which is refered by .menu. Can someone please guide me? Thanks, Sanjeev Edited by: Sanjeev Kumar on Mar 6, 2012 3:02 AM

  • Why is my text not visible in text boxes?

    I have a set of text boxes that I have used throughout my book as little sidebars providing tips to the reader. These text boxes lay out beautifully within iBook Author. When I preview on my iPad, the text within these boxes becomes invisible. The te

  • Problem activating a project with screen-exit

    Hi! Could somebody guide me to activate a project that has the enhancement MM06E005, with many screen-exits? In this enhancement, has many screen exits and I only implemented the 0101 screen (it's appears in me23n). When I activated the project, the

  • Can we still find v5?

    V 5 worked fine and v6 doesnt (see post about not updating or installing apps). Is v 5 anywhere for download? Even when I Google it and the title says V 5 when I go to download its v6.

  • Where to get a patch and how to apply it

    Hi there, I have to ask a really beginners question, so please don't crucify for doing so. I have Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production I'm doing some studying about PL/SQL Hierarchical Profiler. Studying PL/SQL Hiera