How to avoid save option during download in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mageswar005
    New Member
    • Mar 2008
    • 72

    How to avoid save option during download in php

    Hello Guys,
    I want to Avoid the Save option when i click the download link in php .
    I just want open and cancel option only, i dont want save option when i click the download link in php.How to avoid the save option bec for file security reason.

    Detail Description:
    Language i used : PHP
    Db i used : Mysql

    First i upload the file in my application, then i give one link(click here to open) in php, that link is mapped the uploaded files, Now the user click that link means they can able to download the files now, but we need to avoid the download option,we need only open and cancel option.

    Current Scenario: when the user click the link means,it shows [open,save,cance l] .

    Expect Scenario: when the user click the link means, we need to show [open,cancel] only.

    Please some one help me , now i am struggling in this part.

    Regards,
    M.Mageswaran
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Originally posted by mageswar005
    I want to Avoid the Save option when i click the download link in php.
    since PHP is a server side language, you can't click a link in PHP (strictly speaking. you can click a link in HTML though). thus, there must be somewhere a function that builds that link. try changing this function.

    regards

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      This is something that you can not, and should not be able to, control.
      From the server's perspective, opening and downloading the file is the exact same thing. In both cases the server just sends the data to the browser.

      How the browser handles file downloads is up the the browser, and more importantly, the user of that browser.
      Whether the browser fakes an "Open" or just does a straight out "Save" is up to the user.

      From a security standpoint, the Save and Open options are one and the same.
      Both result in your data being downloaded to the client's computer.
      The Open option is simply a shortcut, so the user doesn't have to manually open the file after it is downloaded.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        You'll have to get building your own internet browser ;)

        Markus.

        Comment

        • mageswar005
          New Member
          • Mar 2008
          • 72

          #5
          Give me some idea about this

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by mageswar005
            Give me some idea about this
            There's only one idea to give: it can't be done using PHP. You may, however, be able to do something like this with Flash. But, then again, I don't know much about it.

            Comment

            • Atli
              Recognized Expert Expert
              • Nov 2006
              • 5062

              #7
              Originally posted by mageswar005
              Give me some idea about this
              I suggest you read the earlier responses again.
              They pretty much say it all.

              Comment

              Working...