osCmax v2.5 User Manual
Results 1 to 5 of 5

MAJOR BUG! PDF Virtual Download File Gets Corrupt!

This is a discussion on MAJOR BUG! PDF Virtual Download File Gets Corrupt! within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; When downloading then saving the "Virtual Product" (which is a PDF file) to my desktop and try to open it, ...

      
  1. #1
    Member
    Join Date
    Oct 2003
    Location
    The Antelope Valley in SoCal
    Posts
    47
    Rep Power
    0


    Default MAJOR BUG! PDF Virtual Download File Gets Corrupt!

    When downloading then saving the "Virtual Product" (which is a PDF file) to my desktop and try to open it, Adobe is telling me the file is corrupt.

    When trying to open it directly upon using the "Download" button, Adobe opens, but then it says the file doesn't exist.

    I checked all the permissions - they are fine.

    Using my WsFTP, I ftped a copy of my PDF file back to my desktop to check it and it opens fine.

    Upon checking the "download.php" file, I noticed that there is a bit of code that reads
    // Now send the file with header() magic
    header("Expires: Mon, 26 Nov 2010 12:00:00 GMT");
    header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    header("Content-Type: Application/octet-stream");
    header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']);
    Could the line "Content-type: Application/octet-stream" be corrupting my file during the downloading it as ASCII instead of binary, or is it the other way around? I'm not sure if a PDF is a binary or ASCII . . . .

    I really need to figure this out ASAP - any and all feedback would be appreciated.

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default

    Major Bug is an overstatement. Turn off 'download by redirect' in the configuration - downloads section of the admin.

    PDFs download just fine for me.
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    Member
    Join Date
    Oct 2003
    Location
    The Antelope Valley in SoCal
    Posts
    47
    Rep Power
    0


    Default

    Well, that partially work.

    Adobe still states that "file could not be found" when trying to open from the popup download window.

    However, it does work now when I save the file to a folder or desktop.

    We're halfway there.

  4. #4
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default

    AFAIK you must save a download before opening it. Otherwise it is just a tmp file in the windows tmp dir and windows seems to have a problem rendering that since it does not have the same filename as the actual file.

    I have replicated this behavior in many different programs, not just osCommerce, so I think it due to the method of download as an attachment.

    Fortunately, when downloads occur, you can click the save button, then once it is saved, you can then click the open button in the same popup...
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  5. #5
    Member
    Join Date
    Oct 2003
    Location
    The Antelope Valley in SoCal
    Posts
    47
    Rep Power
    0


    Default

    Thanks, masasek.

    I made posted a note next to the "Download Links" instructing the client to "SAVE" in their account history info page.

    That should work.

    I tried a few other methods for delivery by adding lines to the header()magic, like header(Content-type: application/pdf) and header(Content-transfer-encoding: binary) and header(Content-transfer-encoding: base64), but nothing helped.

    I may still dig into it further, but it is something for another day.

    Thanks again. You 're the man.

Similar Threads

  1. times out when trying to download easy populate file
    By taol in forum osCMax v2 Features Discussion
    Replies: 2
    Last Post: 08-23-2006, 03:21 PM
  2. File Download Not Working
    By Keilup in forum osCMax v1.7 General Mods Discussion
    Replies: 10
    Last Post: 08-15-2005, 10:09 AM
  3. Download results in corrupt file
    By red_fraggle in forum osCMax v2 Features Discussion
    Replies: 0
    Last Post: 07-27-2005, 02:16 PM
  4. Multiple download file for same item possible?
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 05-01-2004, 05:56 AM
  5. Where's the v2.2CVS download file?
    By ezcash in forum osCommerce 2.2 Installation Help
    Replies: 1
    Last Post: 11-20-2002, 10:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •