Hi,
I assume you mean to enter all sort of data about the product, and simultaniously save the image with a certain name.
How about this:
You have your form submit to a PhP page, which handles the insert into the database (This you robably have).
After inserting the information, you have the next part of the page query the database for the product you just entered, and extract the product _auto_increment_id from the database. Then you save the image.
Hope this helps, because it is bedtime here.
Goodnight!
J. 😃