I am developing a from in php with 2 fields (One for Unique name, second for image upload). When submit the form after filling data, I am checking the name field with database records. If the new name exits in the database I am showing a error. this is fine, but i lost the image name what I uploaded before. For this i am using sessions. From sessions I am getting the image name and temporary name and i am passing those through hidden variables. But the image not uploading. Can you please say how can I implement this in my site
Th开发者_JS百科anks Sateesh
Maybe you can send a new ajax request to server and check if name is already used.
If yes - return error and show it on the page, otherwise (no error) - you can submit full form (name and image file) to server. So file will be submitted only once.
精彩评论