Jump to content

Recommended Posts

I just attempted to make a post with an attachment. The attachment was named 'screenshot.png'. I got an error message telling me this file already existed. So I clicked back, then I changed the name of the file, and put that file into the upload box. I clicked post, and I got another error telling me I had already posted that post. So I went back tot he original thread - and my post hadn't been added to the thread. I ended up rewriting the post and uploading the new image, so my problem was solved, but I wanted to point out the errors in programming logic. The way I see it, there are two:

 

1) If a filename already exists, then it should be automatically changed to something else, by adding an appendix or something. Either that or all files should automatically have new names added, using an auto-increment so that filenames are never duplicated. The actual filename could be stored in the database with a reference to the filename, meaning that multiple files could have the same name, but unique ids/filenames.

 

2) If a post hasn't been saved in the database (appended to the thread), then the error shouldn't appear that it has already been posted. This error should only appear after a post has been accepted as complete with no errors, and has been saved in the database.

Link to comment
https://forums.phpfreaks.com/topic/119241-site-error-in-logic/
Share on other sites

I know for a fact that the attachments are stored with a pre-pended key, so I'm not even sure how you got that first error unless you hit submit twice without waiting for the page to respond.  I'm not sure how you got the second error either.  Again, I don't think either of these are SMF errors, or I more than likely would have seen them.

Link to comment
https://forums.phpfreaks.com/topic/119241-site-error-in-logic/#findComment-614230
Share on other sites

I've seen that error numerous times. There is an option in the admin panel called "Encrypt stored filenames" and the help text is

Encrypting attachment filenames allows you to have more than one attachment of the same name, to safely use .php files for attachments, and heightens security. It, however, could make it more difficult to rebuild your database if something drastic happened.

 

I tried turning that on once, but then it broke all the existing attachments and avatars so I had to turn it off again. I just checked the attachment directory and files do have plain text names. I guess SMF just isn't that good.

 

Unfortunately, you will just have to rename the file and try again. You could also try to persuade the SMF team to fix it. There is not much we can do from here.

Link to comment
https://forums.phpfreaks.com/topic/119241-site-error-in-logic/#findComment-614276
Share on other sites

For some reason I had been thinking this was custom forum software - I didn't realize that it's the creation of another company!

 

I could post on the SMF forums, but I don't really care that much, I just thought I would try to help by bringing it to your guys' attention. It's all good though - I just reposted the post with the file attached.

Link to comment
https://forums.phpfreaks.com/topic/119241-site-error-in-logic/#findComment-614421
Share on other sites

I tried turning that on once, but then it broke all the existing attachments and avatars so I had to turn it off again. I just checked the attachment directory and files do have plain text names. I guess SMF just isn't that good.

My guess is that it might be leftovers from the IPB days.  I run several other boards and the files are all stored with a key as part of their name.

Link to comment
https://forums.phpfreaks.com/topic/119241-site-error-in-logic/#findComment-615156
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.