Uploading files with an apostrophe in the filename

Giganews Newsgroups
Subject: Uploading files with an apostrophe in the filename
Posted by:  Alfred Molon (alfred_molonCANC…@yahoo.com)
Date: Sun, 13 May 2007

This is causing problems in a photo contest application I run on a site
(the uploads don't work properly if the filename contains an apostrophe,
such as for instance St Paul's.jpg). I'm using this for the html form:

<input type="hidden" name="MAX_FILE_SIZE" value="10000000" size="40">
<input name="userfile" type="file">

Files are JPEG images and I'm using this to retrieve the image:

$picname = $_FILES['userfile']['name'];
$tmp_picname = $_FILES['userfile']['tmp_name'];
$pictype = $_FILES['userfile']['type'];
$picsize = $_FILES['userfile']['size'];

What code can I use?

--

Alfred Molon
http://www.molon.de - Photos of Asia, Africa and Europe

Replies