jhuckaby / webcamjs

HTML5 Webcam Image Capture Library with Flash Fallback
MIT License
2.5k stars 1.11k forks source link

Webcam.set doesn't rename file name #260

Closed yapja closed 6 years ago

yapja commented 6 years ago

I can't change the default 'webcam.jpg' file name to something unique

jhuckaby commented 6 years ago

Webcam.js has no control over the filename on the server. Your server-side code has to handle that. Webcam.js is merely a client-side JavaScript library that performs a HTTP FORM POST. It's your server code (not included) that takes the raw binary data, sent from the client, and saves it to a file. You can name the file whatever you want.

If you are talking about the upload_name parameter in the Configuration section, this only sets the HTTP POST parameter name. It is not a filename. This is the same as if you were doing a file upload field in a form, and this is the parameter name it would use, similar to this:

<input type="file" name="webcam"/>