Pure PHP Upload 2 Support Product Page

Answered

How to handle wildcards in filenames

Asked 30 Dec 2010 06:04:29
1
has this question
30 Dec 2010 06:04:29 Heather V posted:
Having trouble uploading files that have wildcards in them (i.e, the pound -#- sign).

Is there any way to modify PHP Upload to handle wildcards?

Thank you.

Replies

Replied 30 Dec 2010 22:14:07
30 Dec 2010 22:14:07 George Petrov replied:
Hi Heather,

All special characters are stripped from the filename because otherwise an illegal filename will be saved that can not be retrieved by an url link.

Seems we don't clear the # sign, but you can change in line 75 of ScriptLibrary/incPureUpload.php

from
    $fileName = preg_replace("/\s+|;|\+|=|\[|\]|'|,|\\|\"|\*|<|>|\/|\?|\:|\\$|&|\|/i", "_", $fileName);

to
    $fileName = preg_replace("/\s+|;|\+|=|\[|\]|'|,|\\|\"|\*|<|>|\/|\?|\:|\\$|&|\||#/i", "_", $fileName);


Greetings,
George
Replied 16 Dec 2011 15:33:55
16 Dec 2011 15:33:55 pong lee replied:
Hello there,
My was rename on the file when uploaded to server, but it won't store rename into database record! It store into original file's name of image. For example, "image 01.jpg" it was rename file to "image_01.jpg" on server but in the mysql record are still name "image 01.jpg"
what did i do wrong!!

Reply to this topic