Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-27-2010, 01:07 AM
|
#1
|
LQ Newbie
Registered: Jan 2010
Posts: 3
Rep:
|
Internet Explorer not downloading files from linux server
Hi
Please HELP, really urgent!!!!
i have a very simple php web application deployed on linux (centOS4) machine. It creates a file and stores the file in /tmp folder on my linux machine. The path for this file is specified in the href attribute of the link. Ideally when we click this link the download manager should pop up so that the file can be downloaded on client machine.
When i access this website remotely from my window xp machine on firefox it downloads the file properly but when i run on internet explorer (i have IE7 on my windows XP) and click the link, the download manager does'nt pop's up. even when i right-click that link and select save as, an error message pop's up saying "file path not found". possibly IE is not able to determine the linux file path.........so how do i work around this..........is there some specific way for specifying the linux file paths to be downloaded by IE?
|
|
|
01-27-2010, 05:56 PM
|
#2
|
Member
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567
Rep:
|
sounds like the php web app has a compatibility issue with IE. I would suggest starting by looking into if the php script works on IE. If it does then you can look into why IE can't find the file.
|
|
|
01-27-2010, 06:57 PM
|
#3
|
Member
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488
Rep:
|
Try putting the file somewhere within your /var/www/ directory. IE may not like trying to look above the /www/ directory, if I understand what you are doing.
If you have an ftp server running on the Linux box, you might also try to access it via ftp in IE just to see if that works.
|
|
|
01-28-2010, 12:11 AM
|
#4
|
LQ Newbie
Registered: Jan 2010
Posts: 3
Original Poster
Rep:
|
Hi
thanks for your reply, PHP does runs on IE and am creating my files within the /tmp folder on linux..........however i tried placing the files on the virtual directory (/apache/htdocs or as you said /var/www) and now it downloads the file......... but how can i go about downloading the files placed in /tmp directory.
|
|
|
01-28-2010, 01:27 AM
|
#5
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
This has nothing to do with IE. By default Apache will not serve files outside the server root defined in the configuration file (think about it, do you want someone to be able to download /etc/passwd or other system files?). If you want users to be able to download things from /tmp, you have two choices: (1) create a symlink between a directory in /tmp and somewhere in your webroot, or (2) modify your Apache config to grant access to files in /tmp (actually you should probably do a subdirectory of /tmp since you probably don't want everything in /tmp accessible).
|
|
|
01-29-2010, 12:07 AM
|
#6
|
LQ Newbie
Registered: Jan 2010
Posts: 3
Original Poster
Rep:
|
Hi btmiller
but mozilla is able to access the files kept in /tmp.How is it that apache only restricts IE from downloading file from /tmp directory on linux.
|
|
|
01-29-2010, 12:39 AM
|
#7
|
Member
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567
Rep:
|
Quote:
Originally Posted by pre07
Hi btmiller
but mozilla is able to access the files kept in /tmp.How is it that apache only restricts IE from downloading file from /tmp directory on linux.
|
I have no clue here, but what btmiller says makes sense. Now that I understand what the PHP script is doing I get it. I would create a symlink in /var/www that points to /tmp and then update my PHP script to look at the symlink instead of /tmp.
I am not 100% on this so don't do it without someone else being able to confirm it, but wouldn't giving www-data access to /tmp not resolve this issue as well?
|
|
|
01-29-2010, 01:46 AM
|
#8
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
You'd also need to add a <Directory> entry for /tmp and probably also an alias to the httpd.conf, e.g.:
Code:
Alias /tmp/ "/tmp"
<Directory "/tmp">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory
Apache won't serve up a directory unless you allow it too (the user Apache is running as also does need read access to the directory and all the files within it, as worm5252 points out.
PHP operates entirely on the server side. That is, the PHP script is run by the web server on the server machine and spits out an HTML document that is transmitted back to the client. Compare this with Javascript, which run on the client browser. Apache and PHP work independently of the client browser, so I'm not sure why the OP doesn't have the problem with Mozilla unless there's some browser specific glitch in the HTML coding or something similar.
edit to add: It's probably a really bad idea to allow users to download stuff from /tmp, because any user (include the one Apache runs as) can write to it. This is a security vulnerability. If you must use /tmp, at least create a subdirectory with controlled access and only allow Apache to serve up the subdirectory.
Last edited by btmiller; 01-29-2010 at 01:48 AM.
|
|
|
All times are GMT -5. The time now is 08:10 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|