Okay Stumped on Uploading Local File
| From: | Van | Date: | Thu, 28 Sep 2000 04:27:13 +0000 |
| Subject: | Okay Stumped on Uploading Local File | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17853@lists.php.net to get a copy of this message | ||
Greets, All:
I'm trying:
$fileext = strtolower(strrev(substr(trim(strrev($afile)),0,4)));
$filetmstamp=date(".YmdHis");
$filetmp=tempnam( "", "Res_" );
$filetmp=str_replace("/tmp/",
"A{Floppy}:\REAL_SECRET\\",$filetmp);
$fileid=$filetmp.$filetmstamp.$fileext;
$fix_their_local_file = str_replace("\\","\\\\",$afile);
$fo=fopen($afile,"r");
$fr=fread($fo,1000000);
$res=$fr;
mysql_connect("localhost","dbuser","dbpasswd");
$rs = mysql_db_query("dbdbase","INSERT INTO dbtable
(their_local_file, a_unique_file_id, resume_as_blob_data)
VALUES ('$fix_their_local_file', '$file_id',
'$afile')");
I'm getting:
Warning: fopen("C:\TEMP\Hi there.doc","r") - No such file or directory in
pages/my_php_script.php3 on line umpty_scrunch.
File is submitted with input type=file name="afile".
How do I get the server to apply the input file http post to the stream?
TIA.
Van
=========================================================================
Linux rocks!!! http://www.dedserius.com
=========================================================================