I have the file upload mod working (multiple file upload mod version installed for future, but for now just using it for one upload per record...)
I also am trying to integrate imagemagick to do thumbnails, which works except one thing: when somone uploads a file with a space in the name, imagemagick can't find the file.
I've used the following code which I got from the forum here to strip commas and dollar signs from prices so that they are all on level playing field:
$in{'price'} =~ s/,//g; ### remove comma from entry
$in{'price'} =~ s/\$//g; ### remove dollar sign from entry
However I don't seem to have any luck applying something like:
$in{'file-to-upload-1'} =~ s/ //g; ### remove space from filename
or
$in{'filename'} =~ s/ //g; ### remove space from filename
Doens't do anything and the upload file saved on the local test server still has the spaces in it and the browser shows it as image%20name and imagemagick can't find it to do the thumbnail.
I tried adding those lines to the top of sub validate_upload { and then with no luck above the line:
$filename = $1;
and then with no luck above
push(@Files_Written, "$SAVE_DIRECTORY\/$newdirname\/$filename");
and also in the sub add_record { itself.
Any ideas on how to strip the spaces from filenames people upload using hte multi-file upload mod?
Thanks very much in advance.
I also am trying to integrate imagemagick to do thumbnails, which works except one thing: when somone uploads a file with a space in the name, imagemagick can't find the file.
I've used the following code which I got from the forum here to strip commas and dollar signs from prices so that they are all on level playing field:
$in{'price'} =~ s/,//g; ### remove comma from entry
$in{'price'} =~ s/\$//g; ### remove dollar sign from entry
However I don't seem to have any luck applying something like:
$in{'file-to-upload-1'} =~ s/ //g; ### remove space from filename
or
$in{'filename'} =~ s/ //g; ### remove space from filename
Doens't do anything and the upload file saved on the local test server still has the spaces in it and the browser shows it as image%20name and imagemagick can't find it to do the thumbnail.
I tried adding those lines to the top of sub validate_upload { and then with no luck above the line:
$filename = $1;
and then with no luck above
push(@Files_Written, "$SAVE_DIRECTORY\/$newdirname\/$filename");
and also in the sub add_record { itself.
Any ideas on how to strip the spaces from filenames people upload using hte multi-file upload mod?
Thanks very much in advance.