Forcing a file DOWNLOAD vs open a file when you click on a link... What is the best way to do it?

Hi all

What is the best way to ensure that when a user clicks a download link on a web page that the file is actually downloaded rather than the file open in any program can read? For my case, this includes two types of files, video files (.wmv, mainly) and .pdf files. I want my users to browse I provide for them, then they choose a link, click and the file downloads, NOT to have them play/open.

I started researching on this last night, and the best I could come up with was the suggestion to add "& action = 3Dsave" file as a query string name. So, me being curious, I tried without success to find out whether A) the right way to do it or B) If this query string is the code appropriate to today's standards.

I looked on the Web site of w3c.org not knowing if it was something that was of their Kingdom, but their website has been revamped and is now so cinfusing to navigate that one must become a software engineer to understand.

Any help on this would be most appreciated. Thank you!

Sincerely,

wordman

Create a file with the same name as the video/pdf file but with the extension .php. Insert the following code at the beginning (NO space before that in the file):

<>

Header ('Content-disposition: attachment; filename = yourfilename.xyz');

Header ('Content-type: abc');

ReadFile ('sourcefilename.xyz');

?>

Replace with the file name to "yourfilename" above. sourceFileName may be the same. This gives you just the ability to change names.

You can find a list of the types mime here: http://en.wikipedia.org/wiki/Mime_type

If you know php, you have a lot of files, it would probably be easier to have all the links go on one page with the filename and mime type as parameters. You would then use the simple substitution to do the rest.

Tags: Dreamweaver

Similar Questions

  • I'm moving my files to workspaces to cloud.adobe.  What is the best way to achieve this?

    I'm moving my files to workspaces to cloud.adobe.  What is the best way to achieve this?

    Hi Traci,

    So big that you get ready for the transition to cloud.acrobat.com! Please see that the specified item was not found. For more detailed information on downloading your files.

    When you open a session workspaces, however, you will see a big red box at the bottom left. Click this box, and your files will be packed to the top for you. You will receive an email with the instructions when the packaged files are ready for you.

    Best,

    Sara

  • I want to rename and move files from a shoot 5 d. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    I want to rename and move files from a shoot 5 d on a new drive. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    HI -.

    As a prelude to 2014.0, we have added a feature allowing you to choose what number to start the increment of.  Look in the section ingest Rename dialog and change your preset. When you click the button, you should see the option "Custom Auto Increment". This will allow you to choose what number to start on.  We've also added a few newspapers to try to remember where let prelude last successfully interfere the operation by using this option. So, in theory, to remember the number for you. But if it isn't (maybe you want multiple kickoff ingested at the same time) you can always manually set the number to start with.

    Check that out and let me know how it works for you.

    Kind regards

    Michael

  • I'm doing a pdf to a file and I need to get the size of the file to be not more than 10 MB. What is the best way to do

    I'm doing a pdf to a file and I need to get the size of the file to be not more than 10 MB. Even when I save it, the image quality at least the file size is 10.9 MB. What is the best way to do

    Open the PDF in Acrobat Pro. Choose file > save as other > PDF of reduced size or PDF optimized (which gives you more options).

  • What is the best way to help my friend'd PC to download my files wps of my attachments to email from my XP pc?

    What is the best way to help my friend'd PC to download my files wps of my attachments to email from my XP pc?

    To send your messages with attachments to your friend.  He can then save attachments on his PC.  He will need an application that can handle files of ".wps", although, like the work of processing or Office Word (or WordPerfect, if that's what you used to create them).

    Brian Tillman [MVP-Outlook]
    --------------------------------
    https://MVP.support.Microsoft.com/profile/Brian.Tillman
    If a response may help, please vote it as useful. If a response to the problem, please mark it as an answer.

  • What is the best way to download icons I created on illustrator on a file photoshop of a Web site design?

    I currently trying to design a website on Photoshop. I designed a few icons for the Web site using Illustrator. What is the best way to download these icons on the photoshop file and keep them looking for crisp and high quality? I tried a number of ways, but all seem to come out pixelated.

    What you need to do is to ensure that you create the icons the PPIS and the Photoshop document Illustrator and true to size. If you have created the icons tell with 300ppi, but are in pixels it do not have the same properties that the Web site that you create if that was put in place as 72 dpi and so will distort.

    Once you have mastered that you are better (if you think that there may be changes to the icons later down the line) to create each icon .ai files and place them intt the Photoshop document, and then if you make changes to the source .ai file that it will update in the design of Web sites you.

    If you see no icons change then you can always just copy and paste directly from Illustrator, Photoshop and make changes on the fly, ensuring that keep you it as a smart object.

  • What is the best way to use files recovery

    I work in FM 11 and broke FM a few times. What is the best way to use the recovery files and save them as normal files? So should I filter a window of the Explorer to "recovery" so FM don't ask me if I want to use the older recovery files? Thanks for your help.

    > What is a wash of the MIF?

    1. Save all the files of FM component .mif as MIF format.
      Save the .book as. book.MIF in the MIF format.
    2. Output FM.
      Restart FM.
    3. Open .mifs. Save as FM, replacing the old (FM probably saved files).
    4. Open the. book.MIF, re - register under .book.
      Note: do not open the. first book.MIF and then try to open the component files, or open the files binary pre - MIF.

    FM11 and 12 can have a free add-on as much as the fact in a single operation.

    Washing MIF creates new .book files and FM have syntactically correct data structures (and that may have lack of bad content). They are less likely to crash, but can still have problems.

  • What is the best way to retrieve deleted mp3 files? I am running OSX Leopard 10.5.8 on a PowerPC G5 tower. I'll be very grateful for any help in this matter. Thanks to Chris

    Hello

    What is the best way to retrieve deleted mp3 files? I had a lapse of attention and I deleted a folder containing most of my music files. It is for the most part, the mp3 but there was regular audio files and some wav files in there also. I am running OSX Leopard 10.5.8 on a PowerPC G5 tower. I have another PPC machine to help the recovery, if I need, but at the moment, he is not appearing on my network (3 computers). I'm trying to change this soon. I'll be really grateful for any help in this matter.

    Thanks to Chris

    If you emptied the Recycle Bin after you move the folder to the trash, and you don't have a time Machine or another backup, then it is lost, sorry.

  • What is the best way to read this binary file?

    I wrote a program that acquires data from a card DAQmx and he writes on a binary file (attached file and photo). The data I'm acquisition comes 2.5ms, 8-channel / s for at least 5 seconds. What is the best way to read this binary file, knowing that:

    -I'll need it also on the graphic (after acquisition)

    -J' I need also to see these values and use them later in Matlab.

    I tried the 'chain of array to worksheet', but LabView goes out of memory (even if I don't use all 8 channels, but only 1).

    LabView 8.6

    I think that access to data is just as fast, what happens to a TDMS file which is an index generated in the TDMS file that says 'the byte positions xxxx data written yyyy' which is the only overload for TDMS files as far as I know.

    We never had issues with data storage. Data acquisition, analysis and storage with > 500 kech. / s, the questions you get are normally most of the time a result of bad programming styles.

    Tone

  • What is the best way to clean all the files of the user of a PC under Win98?

    What IS THE BEST WAY to CLEAN ALL USER FILES FROM A PC the wIN98

    Hi Col BROWN,

    Please see the following article on how to perform a clean install:

    http://support.Microsoft.com/kb/221829

    In addition, for more information, please see the following article:

    http://support.Microsoft.com/kb/835826

    I hope this helps!

  • What is the best way to create a backup external to the files from my laptop?

    What is the best way to create a backup external for my laptop files which may be about 40 GB +.

    There are a few utilities in Windows that will help you to back up data. Consult the following link:

    http://www.Microsoft.com/athome/Setup/backupdata.aspx#fBid=UkLRcjvJbN_

    There are many third party tools that will help you to do so. Here's a free:

    http://www.ssesetup.com/SDB.html

  • What is the best way to transfer the file to a new larger internal drive?

    I am running win 7 ultimate.  I had two hard drives of 500 GB.  C is partitioned to 120 GB (not enough) I just installed a 1.5 terabyte drive.  What is the best way to transfer my data? I would keep the 500 GB (now C: and D :) and add the 1.5 to, I also have a 2 external to that I tried to move my libraries at, but I'm confused my system.)  I don't know much about indexing or mapping.

    \

    Consider transferring all the files that are currently in the second partition of 500 GB drive that is hosting the C: drive (you have referred to as D :) on the new drive.

    Once you have done this, you can then delete the D: partition since this 1 hard drive. This would then extend the C: drive to actually use all the 500 GB drive. Finally change the drive letter for the 1.5 terabyte disk d: it in disk management ( Diskmgmt.mscRun)

    So in the end you have a 500 GB C drive and a 1.5 TB drive D.

    When it comes to move libraries Windows has a utility to do it for you. If you click on your username at the top right of the menu start all your user profile directories are displayed. If you right-click on each one and select Properties, those that support this feature will have a tab 'location '. In this tab, it displays the current location of the file, but has a button "move". You move the folder and all its files and subfolders in a new location and update the references, the system uses for this folder.

    So if you created a folder on the D drive say 'Juli-year' and you right-click on Favorites, some properties, then on location you can move this summary folder in C:\Users\username\Favourites to D:\Juli-An\Favourites. Not all folders in the user profile supports this but all the c library files and a few others.

    Of course if you did as I suggested and ended with a 500 GB C drive you may need.

  • I recently bought a computer build-yourself. My question is what is the best way to mirror or save files on the two hard disks at the same time?

    Hello community,

    I recently bought a computer build-yourself.
    My question is what is the best way to mirror or save files on the two hard disks at the same time?
    I know there is a way in diskmgmt.msc, but I can't seem to make it work.
    Spec:
    Windows 7 Professional 64 bit
    8 GB ram ddr3
    2 x 1 TB hard drive

    On Saturday, 22 September 2012 00:53:18 + 0000, kevin.coe wrote:

    As I said, I think it's not only not a good idea, I think it's a very

    a poor man. Backup should be stored outside the computer content. Or
    use a service like Carbonite Online backup.

    Ken Blake, Microsoft MVP

    What is raid? A large number of people I know use raids.

    RAID 1 (mirroring) is not a backup solution. RAID 1 uses two or
    Several readers, each one duplicate of the other, to provide redundancy,
    no backup. It is used in situations (almost always inside)
    companies, not in homes) where any city cannot be tolerated.
    because the way it works is that if a disk fails the other takes
    more seamlessly.

    Although some people thing of RAID 1 as a backup technique, it is
    what it is, because it is subject to a simultaneous loss of the
    original and many of the main dangers facing the mirror
    your data - serious power, close to the lightning seeds, virus
    attacks, stolen computer, etc. Most companies that use RAID 1
    also have a solid plan of external backup in place.

    "Why the RAID is (usually) a Terrible idea".
    http://www.pugetsystems.com/articles?&ID=29
    Ken Blake, Microsoft MVP

  • I found no function 'Receive a file' when you click on Bluetooth icon bar tasks

    Good day everyone,
    I use Windows 8 64 bit on Asus N56VZ-S4324H language
    I have not found the function 'Receive a file' when you click on Bluetooth icon bar tasks,

    So I don't know how to transfer my files from my phone to my laptop.
    I'm trying to fix the error of re - install the Bluetooth driver, but not solve this problem.
    Please help me!

    It's my screen image:
    Thank you all for your help!

    I fixed my problem on bluetooth transfer.


    When I waited longer that normal, I see windows pop up appears on the taskbar.
    Now I transferred files through bluetooth.
    Thank you once again!

    MenPro Admin
  • What is the best way to get a SVG file generated from After Effects?

    What is the best way to get a SVG file generated from After Effects?

    Is there a script to do this? I use the SVG file directly in my work. I did research online, but find that it has no native support of EI to achieve.

    I found some scripts online, but they convert output Adobe AE to the JSON file. Is there something similar available for the SVG file?

    Thank you

    AE makes pixels not vectors, so it's not possible.

Maybe you are looking for