Is there a way to control the URL for the uploaded media files?
I have a setting file (txt file) for another application, and I want that the user can edit the setting from a dashboard in my Wix site, to change the setting file and upload the new version. But my other application will use the same URL to read the settings, so how can I manage to upload the new setting file and change the URL to the old setting file (of course I will delete the old one before)?
You can save the fileUrl's in a database collection.
Use http-function GET request to redirect to the actual file.
The url for the external app can be something like:
https://my-site/_functions/file/fileId
(where file id is the _id in the database collection.
Then in the http-functions.js file in the get_file function get the file from the collection return wixData.get('Files' request.path) and redirect options.status = 301; and options.headers.Location will be the original file url and in the end return response(options).
It might affect the performance though (can be slower)
@Yisrael (Wix) @The Wix Code Team to the rescue?