christopherbrag
02-02-2003, 08:22 PM
Thank you for reading my post...
I have this script:
(It is used for uploading .jpg files to my server)
$filename = $query->param("upload");
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("upload");
open S, ">somedirectory/$filename";
binmode S;
while (<$upload_filehandle>){
print S;
}
close S;
It works by saving the file to my server with its original name. The problem is, I want to save the file with a different name, and when I replace "$filename" (on line: open S, ">somedirectory/$filename") with my own word, such as (file.jpg) The file does not upload to the server properly (It uploads the filename I specified, but the actual file is empty, and of course, will not work.)
If anyone has a solution to this, please let me know
Thank you very much!
I have this script:
(It is used for uploading .jpg files to my server)
$filename = $query->param("upload");
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("upload");
open S, ">somedirectory/$filename";
binmode S;
while (<$upload_filehandle>){
print S;
}
close S;
It works by saving the file to my server with its original name. The problem is, I want to save the file with a different name, and when I replace "$filename" (on line: open S, ">somedirectory/$filename") with my own word, such as (file.jpg) The file does not upload to the server properly (It uploads the filename I specified, but the actual file is empty, and of course, will not work.)
If anyone has a solution to this, please let me know
Thank you very much!