osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

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, ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 05-14-2004, 09:26 PM
Member
 
Join Date: Oct 2003
Location: The Antelope Valley in SoCal
Posts: 47
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
In-Overtime
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
Quote:
// 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 05-14-2004, 10:25 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,990
Thanks: 80
Thanked 345 Times in 324 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
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 Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 05-14-2004, 10:56 PM
Member
 
Join Date: Oct 2003
Location: The Antelope Valley in SoCal
Posts: 47
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
In-Overtime
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 05-15-2004, 02:08 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,990
Thanks: 80
Thanked 345 Times in 324 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
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 Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 05-15-2004, 05:49 AM
Member
 
Join Date: Oct 2003
Location: The Antelope Valley in SoCal
Posts: 47
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
In-Overtime
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 03:18 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax