httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Information Services" ...@texasresearchintl.com>
Subject RE: [users@httpd] Accessing uploaded files ...
Date Mon, 20 Jan 2003 20:48:02 GMT
That did the trick.

Thank you very much.


>>> Owen.Boyle@swx.com 01/20/03 08:27AM >>>
The upload path is hardcoded in the PHP so it's no suprise the upload works (the upload part
doesn't care about the Alias directive).

The problem is with the "Alias" - you need a URL path as the first arg. See notes below.

Rgds,

Owen Boyle

>-----Original Message-----
>From: Information Services [mailto:is@texasresearchintl.com] 
>
>##Alias
>
>Alias /var/www/html/test/clients/uploads /home/test/companies

This line will map the URL:

http://your-server/var/www/html/test/clients/uploads/your-file.html 

to the filesystem directory:

/home/test/companies/your-file.html

I think you really want:

Alias /clients/uploads /home/test/companies

then http://your-server/clients/uploads/your-file.html will go to /home/test/companies/your-file.html,
as required.

>
>
></VirtualHost>
>
>I am using PHP to upload the file, which is working fine. The 
>script for that is here:
>
><?
>function do_file_upload($p_id = "", $c_id="", $userfile="")
>{
>	// do upload
>	//echo "doing upload". $userfile;
>	
>	if (is_uploaded_file($userfile)) 
>	{
>	echo $_FILES['userfile']['name'];
>	}
>		
>	
>	if (is_uploaded_file($_FILES['userfile']['tmp_name']))
>	{
>	
>	opendir('/home/test/companies/');
>	
>			
>		
>move_uploaded_file($_FILES['userfile']['tmp_name'], 
>"/home/test/companies/$c_id/reports/" . $_FILES['userfile']['name'])
>			or die("ERROR_problem uploading the file");
>		
>	}	
>
>	db_connect();
>	
>	$sql = "INSERT INTO test_report (r_name, r_mod_created, 
>r_p_id, r_c_id, r_path)
>			VALUES ('" . 
>$_FILES['userfile']['name'] . "', NOW(), '$p_id', '$c_id', 
>'/clients/uploads/$c_id/reports/' ) ";				
>
>	
>	$result = mysql_query($sql)
>		or die("Problem with insert query - $sql ");
>
>	echo" 
><script>javascript:document.location.href='index.php';</script>";
>	
>}
>
>///////////////////////////////////////////////////////////////
>///////////////////
>?>
>
>Let me know if this is too much or too litte information.
>
>
>
>>>> Owen.Boyle@swx.com 01/20/03 03:11AM >>>
>Need more details on this. Please post the config segment that defines
>the alias. How are you doing the upload? Are you using CGI.pm?
>
>Rgds,
>
>Owen Boyle
>
>>-----Original Message-----
>>From: Information Services [mailto:is@texasresearchintl.com] 
>>Sent: Samstag, 18. Januar 2003 02:01
>>To: users@httpd.apache.org 
>>Subject: [users@httpd] Accessing uploaded files ...
>>
>>
>>OS: RedHat 7.3
>>Apache: 1.3.27
>>
>>We have a virtual host named "server1.domain.com". We have a 
>>page where a user can upload files to a DIR that is Aliased 
>>outside of the Apache root. The alias is working great and the 
>>files actually go to the folder that is outside of the Apache root.
>>
>>BUT
>>
>>When we call the files back using the same Alias we get the 
>>CORRECT path but the file doesn't display. e.g: 
>>server1.domain.com/dir/file.txt
>>
>>It just gives Error 404.
>>
>>Ideas?
>>
>>
>>---------------------------------------------------------------------
>>The official User-To-User support forum of the Apache HTTP 
>>Server Project.
>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org 
>>For additional commands, e-mail: users-help@httpd.apache.org 
>>
>>
>
>This message is for the named person's use only. It may contain
>confidential, proprietary or legally privileged information. No
>confidentiality or privilege is waived or lost by any mistransmission.
>If you receive this message in error, please notify the sender urgently
>and then immediately delete the message and any copies of it from your
>system. Please also immediately destroy any hardcopies of the message.
>You must not, directly or indirectly, use, disclose, distribute, print,
>or copy any part of this message if you are not the intended recipient.
>The sender's company reserves the right to monitor all e-mail
>communications through their networks. Any views expressed in this
>message are those of the individual sender, except where the message
>states otherwise and the sender is authorised to state them to be the
>views of the sender's company. 
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org 
>For additional commands, e-mail: users-help@httpd.apache.org 
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org 
>For additional commands, e-mail: users-help@httpd.apache.org 
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
   "   from the digest: users-digest-unsubscribe@httpd.apache.org 
For additional commands, e-mail: users-help@httpd.apache.org 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message