This topic is locked
[SOLVED]

 File Uploading

3/20/2015 10:12:56 AM
PHPRunner General questions
M
mrphp author

I'm using PHPrunner 7.1 and have a MySQL database for keeping track of mailorder purchases. The record has a field for uploading the pdf invoice to a folder. Originally the uploaded filenames had extra characters added to them automatically to prevent the possibility of previously uploaded files being overwritten. It no longer does this and some files have been overwritten. I don't know what has changed and I can't seem to find how to change it back to the way it was.
I found on one of the forums the following:
"This is done by setting UploadManager's OverwriteFiles property to False before calling Save:

Upload.OverwriteFiles = False" but I don't understand where I do this.
Any help will be much appreciated.
Thanks.

Sergey Kornilov admin 3/20/2015

This is how it works by default. PHPRunner adds a random string to each uploaded file name to prevent files from being overwritten. Normally you just don't need to do anything else.

lefty 3/21/2015

To avoid overwriting files use multiple file upload and set multiple to one ( if uploading one file ) . Do not use compatability mode as this will overwrite your file. Usethe new version multiple upload. If you have no encoding / decoding to change the name of the file on disk or database then just use multiple upload with setting to 1 and do not use events. This will just add random numbers to the end of the file name so theere is no collision on filenames / overwrite . Hope this helps.

M
mrphp author 3/24/2015



This is how it works by default. PHPRunner adds a random string to each uploaded file name to prevent files from being overwritten. Normally you just don't need to do anything else.


That's what I thought but that was no longer happening. I finally went back to PHPrunner and did another Build of the site and that seemed to fix it. It now enters additional characters to the file name.
Thanks for your reply.

M
mrphp author 3/24/2015



To avoid overwriting files use multiple file upload and set multiple to one ( if uploading one file ) . Do not use compatability mode as this will overwrite your file. Usethe new version multiple upload. If you have no encoding / decoding to change the name of the file on disk or database then just use multiple upload with setting to 1 and do not use events. This will just add random numbers to the end of the file name so theere is no collision on filenames / overwrite . Hope this helps.


I think my problem is solved (see above) but I'm curious about your response. Where are the settings you are describing? In PHPrunner when I select File/Image there is an option for maximum number of files but I'm not following how I can set it to "multiplle file upload" and set it to "1". I also don't see a "compatibility" mode. I'm thinking that may be because I'm not using a recent version or it could be I'm just clueless <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=77039&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />
Thanks for your help.

Sergey Kornilov admin 3/24/2015

'Compatibility mode' option will only appear if you use on of latest PHPRunner versions and open project created by older version.

M
mrphp author 3/30/2015



'Compatibility mode' option will only appear if you use on of latest PHPRunner versions and open project created by older version.


Got it. Thanks.