Re: uploading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello...


<?

...
...
...

	$pat = array("#", "@", "*", "#", "@", "$","'", "`");
	$w= '_';
	$pic_name2 = str_replace ($pat, $w, stripslashes($pic_name));

$query = "INSERT INTO Travel_Design (Travel_Design_Num, Season, Date, 
name, filesize, filetype ) VALUES ( '$Travel_Design_Num', '$Season', 
'$Date', '$pic_name2',  	'$pic_size', '$pic_type')";
exec ("cp '$pic' './images/$pic_name2'");

...
...
...
?>



$pic comes from a form...I strip out any unwanted junk( it's better 
when you want to display the file)....I insert the Data to the 
Database, including the file's location....and copy the file where it 
belongs...

The actual file is uploaded into a temp directory......you have to copy 
or move the file from that spot to where you want it...At least with 
Linux...


Dan




On Tuesday, November 5, 2002, at 04:03  PM, ryan@hgilive.com wrote:

> I have been trying to get this to work as well, where I am lost is what
> is the upload.php file supposed to contain, other than the below lines
> that Edward was mentioning
>
> Just lost
> Thanks
> Ryan
>
> -----Original Message-----
> From: Edward Peloke [mailto:epeloke@echoman.com]
> Sent: Tuesday, November 05, 2002 12:45 PM
> To: php-db@lists.php.net
> Subject:  uploading
>
> I am playing with uploading files. The names will then be stored in the
> db.
> I have a
> simple form:
>
> <form action="upload.php" method="post" enctype="multipart/form-data">
>   Send these files:<br>
>   <input name="userfile[]" type="file"><br>
>     <input type="submit" value="Send files">
> </form>
>
> Which calls a php file that just contains this:
> copy($_FILES['userfile']['tmp_name'], "\ufiles\");
>
>  This ufiles folder is under my htdocs folder in apache.  I have looked
> through the help files in php.net but am just not getting it today.  
> How
> do
> I simply upload the file?  I tried to move uploaded file function but
> can't
> seem to get that to work also....any ideas would be greatly 
> appreciated!
>
> Thanks,
> Eddie
>
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux