|
|

12-03-2012, 06:21 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,217
|
|
|
if the image's suffic is jpg/png etc, I think still ok to use X-LiteSpeed-Location
the X-LiteSpeed-Location is like redirect (but internal not external), pass this file to web server(here litespeed) to handle it. so if the file name is .jpg, web server will think it a jpeg image and generate proper headers for it.
|

12-03-2012, 06:22 PM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 43
|
|
Quote:
Originally Posted by NiteWave
if the image's suffic is jpg/png etc, I think still ok to use X-LiteSpeed-Location
the X-LiteSpeed-Location is like redirect (but internal not external), pass this file to web server(here litespeed) to handle it. so if the file name is .jpg, web server will think it a jpeg image and generate proper headers for it.
|
Unfortunately my site doesn't retain the extension of the file on the disk (but does in the database) - is there any way to trick LiteSpeed into thinking it's a .jpg?
|

12-03-2012, 07:51 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,217
|
|
|
I have an idea in your php script, create a temporary symbolic link to the file, like a.jpg, then "X-LiteSpeed-Location: /path/to/a.jpg". when download complete, delete a.jpg. or create a cron job, clean up these temporary soft link(a.jpg) which created 1 hours ago(for example).
|

12-05-2012, 03:54 PM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 43
|
|
Quote:
Originally Posted by NiteWave
I have an idea in your php script, create a temporary symbolic link to the file, like a.jpg, then "X-LiteSpeed-Location: /path/to/a.jpg". when download complete, delete a.jpg. or create a cron job, clean up these temporary soft link(a.jpg) which created 1 hours ago(for example).
|
Thanks, I'll give it a shot. Can I remove the symlink after the X-LiteSpeed-Location header? ie.
header('X-LiteSpeed-Location: /files/tmp/temp.png');
unlink('/files/tmp/temp.png');
When using them in that order I receive the following error in LiteSpeed:
detect loop redirection
Last edited by Banana Lord.; 12-05-2012 at 04:34 PM..
|

12-05-2012, 06:53 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,217
|
|
Quote:
Can I remove the symlink after the X-LiteSpeed-Location header? ie.
header('X-LiteSpeed-Location: /files/tmp/temp.png');
unlink('/files/tmp/temp.png');
|
No, can't.
since the temp.png not sent to user yet.
the 1st line is to tell litespeed web server, "please send this file to user"
maybe you have to
Quote:
|
create a cron job, clean up these temporary soft link(a.jpg) which created 1 hours ago(for example).
|
|

12-07-2012, 12:50 PM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 43
|
|
Quote:
Originally Posted by NiteWave
No, can't.
since the temp.png not sent to user yet.
the 1st line is to tell litespeed web server, "please send this file to user"
maybe you have to
|
Thanks, I've got an idea for that now.
I am using the symlink option to send files to the user via X-LiteSpeed-Location (with the extension), but it seems that extension was not sent with it.
|

12-07-2012, 02:39 PM
|
|
LiteSpeed Staff
|
|
Join Date: Oct 2010
Posts: 2,337
|
|
Quote:
Originally Posted by Banana Lord.
...
I am using the symlink option to send files to the user via X-LiteSpeed-Location (with the extension), but it seems that extension was not sent with it.
|
make sure you can serve image file with extension directly (i.e., MIME type is supported) before serve via X-LiteSpeed-Location.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 01:30 AM.
|
|