Attachments cannot have the same name

Started by spoogs, 8 years ago

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

spoogs

*
8 years ago
I'm not sure if this is intended but it make trying to help other a bit tedious.

A user posted their modifications.english.php and when I tried to upload the corrected file I got an error message saying it cannot have the same name as an existing attachment.

Its a bit much to have to guess what names have been used for attachments.


Spoogs

Feline

*
#1
8 years ago
That have nothing to do with the portal .. it's SMF .. you can't uplaod a file that exist  ;)

Fel
Many are stubborn in relation to the way, but less in relation to the target.

spoogs

*
#2
8 years ago
I do this all the time on other sites... even at smf and never saw that message before

I know its not a portal issue... Site Comments ;)

here

Feline

*
#3
8 years ago
Sorry .. but I understand nothing  :-\

Fel
Many are stubborn in relation to the way, but less in relation to the target.

b4pjoe

*
#4
8 years ago
On my forum, if you upload an attachment and one with that name already exists, it overwrites the original without any kind of warning. Could be a server setting maybe instead of SMF?

Feline

*
#5
8 years ago
It's definitivly SMF ..

Checks here ..
Code Select
// Make sure the file actually exists... sometimes it doesn't.
if ((!$file_restricted && !file_exists($attachmentOptions['tmp_name'])) || (!$already_uploaded && !is_uploaded_file($attachmentOptions['tmp_name'])))
{
$attachmentOptions['errors'] = array('could_not_upload');
return false;
}


Fel
Many are stubborn in relation to the way, but less in relation to the target.

b4pjoe

*
#6
8 years ago
I wonder why my forum just overwrites the file? Or is that code something new in RC4? I haven't upgraded past RC3.

Feline

*
#7
8 years ago
I don't know .. I have not compared the versions ...

Fel
Many are stubborn in relation to the way, but less in relation to the target.

spoogs

*
#8
8 years ago
Quote from: feline, 8 years ago
Sorry .. but I understand nothing  :-\

Fel
Look at the example

user uploaded his load.php file.. I downloaded it made some edits and uploaded a file called load.php

here on this site thats cannot be done I would have to change the name to load1.php or something like that.

Here is the thread on this site https://www.portamx.com/uninstall-pmxblog-error.msg12750.html/topicseen#msg12750

Feline

*
#9
8 years ago
Quote from: spoogs, 8 years ago
here on this site thats cannot be done I would have to change the name to load1.php or something like that.

As I say ... SMF checks for duplicate filenames ..

Fel
Many are stubborn in relation to the way, but less in relation to the target.

b4pjoe

*
#10
8 years ago
I just checked my RC3 live forum and my RC4 test forum and I was mistaken. Each attachment is given a unique name when uploaded so I never see the message that spoogs is seeing here at the portamx site. If you go to the thread he linked and try to make a post and upload the file "Modifications.english2.php" it will give you the error shown below.

And as you can see the attachment image I attached is not showing as an image.

[attachment deleted by admin]

Feline

*
#11
8 years ago
We can make a long, long discussion about this .. but fact is, that a unpached SMF 2.0 RC4 checks for duplicate filenames.
I have posted the part from SMF code above ...

Fel
Many are stubborn in relation to the way, but less in relation to the target.

spoogs

*
#12
8 years ago
Well as i said this is only happening here.. I dont need the code for anything... I only noticed when I was trying to help someone here on this site... I cant be bothered to guess which file names have already been used.

b4pjoe

*
#13
8 years ago
Quote from: feline, 8 years ago
We can make a long, long discussion about this .. but fact is, that a unpached SMF 2.0 RC4 checks for duplicate filenames.
I have posted the part from SMF code above ...

Fel


Yes, on other forums, SMF checks for the duplicate file name and renames the files accordingly if it finds a duplicate. On your site the attachment fails if there is already an attachment of the same name instead of giving it a unique name in the attachment folder. So your site is handling attachments differently than other SMF forums.

* Shouts

Feline
8 months ago
Today we update our Forum to the Version 1.45
Feline
11 months ago
Today we update our Forum to Version 1.4
This release is full compatible with the EU GDPR
Feline
a year ago
Update for PortaMx 1.54 ecl released.
With this updates the Portal works with PHP 7.x and SMF 2.0.15
Feline
a year ago
PortaMx Forum 1.3
released !

*
Feline
a year ago
Today we switched to PHP 7.2 and activate Opcode caching.
Fast .. Very fast *
Feline
2 years ago
Today we upgrade our old SMF 2.0 Forum to PortaMx Forum *

* Calendar

Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31