LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > Can't load multiple PHP pages at once

Reply
 
Thread Tools Display Modes
  #11  
Old 12-03-2012, 06:21 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,293
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.
Reply With Quote
  #12  
Old 12-03-2012, 06:22 PM
Banana Lord. Banana Lord. is offline
Member
 
Join Date: Mar 2011
Posts: 43
Quote:
Originally Posted by NiteWave View Post
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?
Reply With Quote
  #13  
Old 12-03-2012, 07:51 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,293
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).
Reply With Quote
  #14  
Old 12-05-2012, 03:54 PM
Banana Lord. Banana Lord. is offline
Member
 
Join Date: Mar 2011
Posts: 43
Quote:
Originally Posted by NiteWave View Post
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..
Reply With Quote
  #15  
Old 12-05-2012, 06:53 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,293
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).
Reply With Quote
  #16  
Old 12-07-2012, 12:50 PM
Banana Lord. Banana Lord. is offline
Member
 
Join Date: Mar 2011
Posts: 43
Quote:
Originally Posted by NiteWave View Post
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.
Reply With Quote
  #17  
Old 12-07-2012, 02:39 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,390
Quote:
Originally Posted by Banana Lord. View Post
...
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.
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -7. The time now is 01:40 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.