in reply to Reading a File Uploaded to a cgi script
You have single quotes around $filename, thus preventing it from being interpreted. Get rid of them.$fh = $query->upload('$filename');
What it looks like is happening is that it was looking for a file field named, literally, '$filename'. It wasn't finding one-- yet the file got uploaded OK, so there was no error message. (I'm not sure why your "CENTER" tag didn't appear, though.) The following idiom might be clearer:$fh = $query->upload($filename);
eval { ## ... $fh = $query->upload($filename) or die "No file uploaded: '@{[ $query->cgi_error() ]}'"; ## ... }; $@ and do { print_html($@); };
stephen
|
|---|