LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 01-27-2010, 01:07 AM   #1
pre07
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
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?
 
Old 01-27-2010, 05:56 PM   #2
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
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.
 
Old 01-27-2010, 06:57 PM   #3
pentode
Member
 
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488

Rep: Reputation: 38
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.
 
Old 01-28-2010, 12:11 AM   #4
pre07
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 01-28-2010, 01:27 AM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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).
 
Old 01-29-2010, 12:07 AM   #6
pre07
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 01-29-2010, 12:39 AM   #7
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
Quote:
Originally Posted by pre07 View Post
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?
 
Old 01-29-2010, 01:46 AM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to access ftp server via Internet explorer satishap Linux - Server 5 09-14-2008 04:44 PM
downloading files from internet newtovanilla Linux - Newbie 6 05-01-2008 09:52 AM
internet explorer for linux sailu_mvn Linux - Software 13 07-26-2005 10:33 AM
Using Internet Explorer (or some other easy equivalent) with my FTP server MercuryRaz0r Linux - Software 2 01-01-2005 11:37 PM
downloading files from linux server sam99 Linux - Software 0 03-10-2004 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration