Jump to content

Question about content-type


mulysa

Recommended Posts

Situation:

I have 2 files, file: makelink.php and downloadit.php

makelink.php 's functional is to logging and avoid direct link abuse.

downloadit.php 's functional is to initiate download popup to browse no matter what type of file is.

 

Example:

Makelink.php will produce the example link as below.

http://localhost/downloadit.php?action=download&fid=1d5bb0f8cf058c1f00df85bd2ea68953

 

Problem:

If these 2 files are on the same server it work fine (). it can issue download dialog (with content-type: octet stream) properly.

But, due to bandwidth problem, I have to seperated downloadit.php and makelink.php to difference server.

Now, makelink.php generate links as below

 

http://other_of_myserver.com/downloadit.php?action=download&fid=1d5bb0f8cf058c1f00df85bd2ea68953

 

Now, this is where problem happen makelink.php behave like it used to be properly, but downloadit.php is not.

Instead of issue "content-type: octet stream" as it used to be to browser. It 's not. It was issued "content-type: text/html" which mean that even .zip, .rar file all of them will display on the browser window as text. No download popup at all ??

 

I am 100% sure that downloadit.php was coded in proper way since it working properly if located in the same server as makelink.php

 

 

I have tried to investigate this issue with Firebug plugin and all possible log messages for  3 days, but still no luck at all.

If anyone can shred me some light on this I would be more than glad to thank you.

 

 

Link to comment
Share on other sites

are both servers same version of php and also check if you have whitespace, if whitespace errors (and you are supressing errors) it will display as text/html and not dispay error.  check the source code for errors also. (of download.php)

 

 

 

Both server are not same version , but each of them and produce the good result if both makelink.php and downloadit.php are on the same server.

 

The white space error for this one I am not quite sure. but atleast if it workfine once it located in the same server, I don't think it got this problem anyhow. I will try to double check it again.

 

I have even try to make a symlnk to downloadit.php on other server as below:

 

main server (where makelink.php located):

 

But, It doesnt work, I got this error in http log: Symbolic link not allowed or link target not accessible

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.