Pure PHP Upload 2 Support Product Page

Answered

How to handle wildcards in filenames

Asked 14 years ago
1
has this question
14 years ago 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 14 years ago
14 years ago 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 13 years ago
13 years ago 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