• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

Rename Images to Image URL ID

Status
Not open for further replies.

BigBoiJefe

Chevereto Member
I know this is might be a strange request, but I have to ask because it will help me with hotlink protection. When a user uploads an image, say it's a jpg image, the url it creates, is http://gagr.com/image/iK0. Is it possible to store the image as iKo.jpg?

The reason for this is for a custom hotlink solution that will redirect the user to the frontend image if the direct image is shared in skype or what not. I understand that this wont do anything for image embedding but, it'll help me enormously.
 
I guess the idea would be that there would be an option called Image URL in Dashboard> Image Upload > File naming method
 
Problem with this is that the ID comes right after when the image is inserted to the database table which is done after the file upload process. This means that to implement this I need to rename the uploads and it could be tricky to achieve that when it comes to external storage. Main problem is always the "what if" which in this case is what if the rename can't happen?

An alternative could be to reserve the next ID to be inserted but I'm afraid that MySQL doesn't implement such feature, and is not simple as get the last_id + 1 because someone else could be uploading an image which takes less time and in this case that request will get the ID before. The way to emulate this (which is an Oracle DB thing) could be to create a table with the reserved id<->process, which allows to manage the ID reservations and therefore get the target filename before actually uploading the file.

I will keep thinking about it.
 
Last edited:
Status
Not open for further replies.
Back
Top