formcreator icon indicating copy to clipboard operation
formcreator copied to clipboard

Auto rename for uploaded files with the same name

Open leecheromerevilit opened this issue 2 years ago • 3 comments

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

leecheromerevilit avatar Jul 26 '23 05:07 leecheromerevilit

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.

btry avatar Jul 26 '23 06:07 btry

Hi

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

leecheromerevilit avatar Jul 26 '23 06:07 leecheromerevilit

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.

btry avatar Jul 26 '23 06:07 btry