Watch out for this pitfall with upload files

So I had this issue with uploaded files apparently becoming corrupt over time -- whether PDF or MS Office, users reported getting corrupted downloads. I couldn't figure it out. Then I thought to check and see if the file referenced in the database actually existed in the /files directory -- lo and behold, they did not!

What happened? Well, when I update an existing app, I create a new folder for it on the server and deploy to the new folder, then point IIS at the new folder. So, you can guess what happened... the older files were still in the old app folder. Fortunately for me, I don't delete those old folders right away -- more than once I've had to revert back to an older version while debugging some new prematurely-released code. So I was able to copy the old files to the new folder and all is well.

But now I'm going to start a new practice of having a common upload location that is absolute and won't change when the app folder changes. Te other option is to try to remember to merge the file folder with each new deployment -- something I don't trust myself to do.

So I had this issue with uploaded files apparently becoming corrupt over time -- whether PDF or MS Office, users reported getting corrupted downloads. I couldn't figure it out. Then I thought to check and see if the file referenced in the database actually existed in the /files directory -- lo and behold, they did not!

What happened? Well, when I update an existing app, I create a new folder for it on the server and deploy to the new folder, then point IIS at the new folder. So, you can guess what happened... the older files were still in the old app folder. Fortunately for me, I don't delete those old folders right away -- more than once I've had to revert back to an older version while debugging some new prematurely-released code. So I was able to copy the old files to the new folder and all is well.

But now I'm going to start a new practice of having a common upload location that is absolute and won't change when the app folder changes. Te other option is to try to remember to merge the file folder with each new deployment -- something I don't trust myself to do.

Been there done that. Same concern with signature pad plugin. BE CAREFUL
I prefer uploading files to the database, so it isn't often I have to care too much.