trying to get the url of capture image after its saved to server with a random name

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

trying to get the url of capture image after its saved to server with a random name

I'm trying to fetch/get the url or entire name of image i capture from a video. I've managed to save the capture as an image in the server with a random name but cannot get the url or entire name to echo or even am able to save it to the mysql instead i keep getting the name resource 4 or 2341 number repeating inside the mysql database however a new image with a new random name appears in the server. The post img val is the capture image.

I'm guessing $rawData is an image String, in which case, base64_decode won't return the image you're expecting as you still haven't made the image. When you enter it into your database, you're probably seeing part of the String. Assuming you know that the image will be a .png (or some other file type as long as it's known):

I removed the explode line as there's really no need to break apart the image String, unless you absolutely need to do that for a specific purpose.

If you plan to save the images, I wouldn't use a random number generator for a file name as you may end up having files with multiple images (or image Strings) and it would be hard to keep track of that in your database. Not to mention, when you read the file, you're going to have to check whether there are multiple images (or image Strings), all of which creates unnecessary work. I would be easier and more effective to increment the file names. Doing it this way, you'd just need to get the last row to find out which number to increment from when you want to insert files later on.