473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ssl file download problem

190 100+
HI All,

I have problem in files downloading over ssl. When am trying with IE Browser i got

"Internet Explorer cannot download 40 from blah.gov
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later."

Whem am tried with mozile firebox i can download small size files but could not download max size files... here my code

Expand|Select|Wrap|Line Numbers
  1. if(is_file($dir."/".$file))
  2.   {
  3.   header("Content-Disposition: attachment; filename=\"$file\";");
  4.   header("Content-Type: file/x-msdownload");
  5.   header("Content-Length: ".filesize($dir."/".$file));
  6.   //echo file_get_contents($dir."/".$file);
  7.   $handle = fopen($dir."/".$file, "rb");
  8.   while (!feof($handle)) echo fread($handle, 8192);
  9.   fclose($handle);
  10.   }
  11. else if(is_dir($dir."/".$file))
  12.     {
  13.     include_once("lib/zip.lib.php");
  14.  
  15.     $newzip = new zipfile();
  16.     chdir($dir);
  17.     $name=$file;
  18.     add_dir($name,$newzip);
  19.  
  20.     header("Content-Disposition: attachment; filename=".$name."_navphp.zip");
  21.     header("Content-Type: file/x-msdownload");
  22.     $data=$newzip->file();
  23.     header("Content-Length: ".strlen($data));
  24.     echo $data;
  25.   }  
  26.  
am using to add some methods like
header("Cache-Control: no-store, no-cache, must-revalidate");
but not succeed ... what is the problem....
Jun 9 '09 #1
4 3015
Atli
5,058 Expert 4TB
Hi.

You might have to enable SSL in IE.
You can find that in Tools->Internet Options->Advanced and then find the SSL options near the bottom of the list.

As to why Firefox would have problems with this, I do not know.
Is it giving you any errors? (Check the Tools->Error Console window)
Jun 9 '09 #2
maheswaran
190 100+
Off course i enabled ssl option in IE.

Tools->advanced->use ssl 1.0 & 2.0 & 3.0
Jun 10 '09 #3
maheswaran
190 100+
Hi All,

i got the answer.... I have modified my code as below and download is working fine....

Expand|Select|Wrap|Line Numbers
  1. header("Pragma: public");
  2.       header("Expires: 0");
  3.       header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  4.       header("Cache-Control: private",false);
  5.       //header ( "Content-Type: $filedatatype" );
  6.       header("Content-Disposition: attachment; filename=\"".$file1."\";");
  7.       header("Content-Transfer-Encoding:* binary");
  8.       header("Content-Length: ".filesize($file));
  9.  
But do not know why this code work under ssl... my guess is to determine the cache control is the solution....
Jun 10 '09 #4
Atli
5,058 Expert 4TB
I'm glad you found a solution!
Thanks for sharing it.

@maheswaran
I would put my bet on the Content-Transfer-Encoding:* binary header.
It tells the browsers how the data is encoded during the transfer.
Perhaps this is required when dealing with SSL transfers.

In any case, you can just comment the headers out, one by one. See which one causes the download to fail.
Jun 10 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily...
1
by: ASP Spam Fighter | last post by:
Hello all, I don't know how to get around this one... If anybody can help me with this problem, I would appreciate it very much. I've been trying to send a (large) file to the browser via a...
3
by: Michael Bøcker-Larsen | last post by:
Hi I'v been stuck on this problem for ages now. I have found that I'm not the only one with this problem, by looking through the different newsgroups. Hope you can help me! I know there is a...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
2
by: Ken Varn | last post by:
I have an ASP.NET page that incorporates the following code on a button press. private void DownloadTag_Command(object sender, CommandEventArgs e) { FileStream fs; String Filename; Filename...
2
by: Andrew Jocelyn | last post by:
Hi I get this error when I change something in the web.config file. When I build the VS projects and load the first web page the application runs fine. If I then make a save the web.config file...
6
by: rony_16 | last post by:
Hi, I have problem with downloading a file using WebRequest and HttpWebResponse. Inorder to download this file i need to call to url that tells to prepare the file for download, and then i call...
3
by: tshad | last post by:
I have a function that downloads a file to the users computer and it works fine. The problem is that I then want the program to rename the file (file.move) to the same name plus todays date. ...
4
by: pradqdo | last post by:
Hi folks, I have a very strange problem when I try to port my client/server program to cygwin. It is a simple shell program where the server executes client's commands + it can send and receive...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.