Issue with multiple users uploading own texture to the game

Hi everyone,

I’m making an application where the user can upload a texture that is then displayed on a 3D model.

My current solution: The user uploads an image file through html form / php script. Php script always saves the texture under the same name, e.g. newTexture.jpg, and then forwards the user to the webplayer. Webplayer opens newTexture.jpg, and puts it on the model.

The possible problem: If two users were to upload their file at the same time, I think it might be possible that one overwrites the others file before the webplayer has loaded, so that both end up with the same picture, even though one of them uploaded a different one.

Is there a better way to do this? Are there best practices to communicate between php and webplayer?

This seems very implementation dependent, you might want to give some additional code/steps. Either way, possibly you could attach a timestamp to fix the problem. Also, consider notifying the client when an image has been uploaded instead of letting the client only fetch the image at start time (if you’re doing this).