pluginsGLPI / formcreator

GLPI Plugin Formcreator (DOWNLOAD : https://github.com/pluginsGLPI/formcreator/releases)
http://www.teclib-edition.com
GNU General Public License v3.0
174 stars 125 forks source link

Auto rename for uploaded files with the same name #3340

Open leecheromerevilit opened 1 year ago

leecheromerevilit commented 1 year ago

Describe the bug When uploading files with the same file name and type, there's a chance na 1 file will have random characters added to its original filename.

To Reproduce Steps to reproduce the behavior:

  1. Create form with an filefield.
  2. Submit form with attached file "silver caddy.pdf"
  3. Submit another form with the same file "silver caddy.pdf"
  4. Check each form, there's a chance that the 2nd file will have a random character on its filename.

Expected behavior There should be no random characters on the file name.

Screenshots

Screenshot 2023-07-26 at 13 57 39
btry commented 1 year ago

Hi

This might be complicated to resolve because the files are uploaded once when the user fills and submit the form, then the plugin dies many things to emulate a second upload when a target is created.

As this is just an annoyance, I'll focus on more impacting issues first.

leecheromerevilit commented 1 year ago

Hi

I agree, can this be handled by the plugin itself or this will be resolved on the glpi level?

btry commented 1 year ago

I don't know, a code analysis is required first.

The plugin needs to handle the random string of files in the upload process. I'm suspecting thar your use case needs a deep analysis with a debug session.