
CuzDesign
Deleted
May 29, 2000, 10:55 PM
Post #3 of 7
(259 views)
|
|
Re: File upload: save under same name?
[In reply to]
|
Can't Post
|
|
With the code I gave you should handle uploading the file for you without adding any temp file names or temp files. By looking at your code it looks as though you are telling it to write 2 files instead of one: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> open (SOURCE, "$file_name") or die "$!"; open (TARGET,">c:\Temp\$file_name") or die "$!"; binmode(SOURCE); binmode(TARGET); </pre><HR></BLOCKQUOTE> Try taking out the TARGET file and only useing the other one. Like so: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> sub Upload_File{ open (SOURCE, "$file_name") or die "$!"; binmode(SOURCE); while ($bytesread=read(SOURCE,$buffer,1024)) { print SOURCE $buffer; } #while close OUTFILE; } #end of sub </pre><HR></BLOCKQUOTE> Hope this helps. Regards, Ray
|