Media : a little inconsistence

Library - Media - add media - file “plan.pdf” - give no specific Name - upload -->
media is in library, Name is “plan.pdf”, file Name is “Plan.pdf” ok

Now do it again the same way, you get the message “You already own media with this name. Please choose another.”

Now do:
Layouts - make an empty one - choose PDF to add - select file “Plan.pdf” from your file System - upload without spedific Name
no error message, but new media in library witrh Name “Plan(1).pdf” and also the file Name

your layout - designer - delete pdf in timeline AND in library
in preview of the canvas you can still see the pdf, but timeline is empty

library - media - add media - select the same file again and upload
you get plan(1).pdf as the Name and the file Name instead of plan.pdf

the only way to replace media in library is to use it within a timeline of a layout and edit. there is a button “replace” with the nesessary functions. This button should reside within “add media” and all other Dialog Windows of this matter.

Thank you for your analysis! :smile:

I think the root cause of this behaviour is that files which fail to upload are not being deleted from the temporary upload folder. When you try to upload the next file, PHP automatically appends the (1). I’ve created an issue to investigate that here.

You can also replace media from the edit form in Library.

The add form does not have any context with which to determine what you are replacing (going entire on the file name would be too vague).

my upload Tests do not fail, every upload makes the right entry in the library and you can use the media.
the more often you make the procedure described, you get plan(1).pdf, plan(2).pdf, plan(3).pdf… and so on.
when you delete this media and add the same again you get plan(4).pdf.
None of these Uploads failed.

ok, the add form is perhaps the wrong place for the button…
I will Change “edit” to “edit/replace” within my german translation

I think the issue is not that the upload failed, but that ultimately the media item wasn’t accepted in to the library (because there was an error), and therefore that temporary file is left in place - as described in the bug report Dan has filed for this.