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



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Closed Thread

 

LinkBack Thread Tools
  #1  
Old 05-14-2004, 08: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!
  #2  
Old 05-14-2004, 09:25 PM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,719
Thanks: 139
Thanked 607 Times in 519 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

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

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 User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 05-14-2004, 09: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, 01:08 AM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,719
Thanks: 139
Thanked 607 Times in 519 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

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

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 User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 05-15-2004, 04: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!
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 03:21 PM
File Download Not Working Keilup osCMax v1.7 General Mods Discussion 10 08-15-2005 10:09 AM
Download results in corrupt file red_fraggle osCMax v2 Features Discussion 0 07-27-2005 02:16 PM
Multiple download file for same item possible? Anonymous osCMax v1.7 Discussion 1 05-01-2004 05:56 AM
Where's the v2.2CVS download file? ezcash osCommerce 2.2 Installation Help 1 11-20-2002 10:33 AM


All times are GMT -8. The time now is 02:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax
Inactive Reminders By Icora Web Design