How change file name when uploading a new file

Here is an example of what I need.

My clients ask us to mockup a tshirt. We have a dropdown list of different locations their artwork goes on the tshirt (Front, Back, Sleeve, etc…). They can then upload their artwork for us to mock it up. However their file names are always quite crazy, and I want to just change the name to the location. For example the file name would be Front.ai or Front.pdf so it doesn’t change file extension or the file itself, just the name.

Is there a way to do this when creating the new thing?

Hmm :thinking: Good question. I don’t think there is a way to do that with the native bubble uploader but maybe you can use a different plugin. Maybe try something like this: File & MultiFile Uploader · BEP Plugin | Bubble or this: Better Uploader Plugin | Bubble

Or you can check out other upload plugins from the plugins page.

Let us know if one of those works better. :blush:

1 Like

normally I save the file name as a separate field in the database

this allows the user to change it to whatever they want
and allows me to write it on creation as well

I also write the size and file type as these are useful

file type is good for changing whether to show an image or an icon of a video, or knowing when to fetch a thumbnail for a video for instance

1 Like

Thanks guys. Was trying to do it more systematically but this is a decent workaround. Thank you

Technically, you can do this by creating your record via an API call to your own app with the API connector.

Make sure you have Data API enabled and the “neworder” data type enabled in API settings… plus privacy rules to protect the data type’s API access!

In the request, you’d send all the information about the file as detailed here: The Bubble API | Bubble Docs

It’s very much a “long way around” to create a record, but it does allow you to name the actual file uploaded.

With that said, @J805 and @mitchbaylis 's suggestions are great solutions too.

1 Like

This plugin: File Uploader Bubble API Plugin | Bubble
was created to work with file coming from API Connector that doesn’t have a name. This upload a new version of the file and let you set the file name and privacy settings. You just need to delete the previous version of the file after.

1 Like

That is good to know. If they allow it with API access, you would think it would be easy for them to add it to the front end too. Maybe for the next ‘bubble boosts’. :blush: :man_shrugging:

1 Like