Using the Update Record and retaining old filename
Question:
When I use the Update Record together with Pure ASP Upload and no upload file is given by the user, an empty filename is saved. I want to keep the old filename if no new one is given.
Answer:
You can easily do this by making sure that the file upload control is bounded with the filename value field in the recordset used to store the filename.
You will probably have already a recordset on the page used to populate all the data in the upload form. Just select the file upload control then go to the bindings select the recordset and then the field used to store the filename value and click on "bind"
When you save your page an extra hidden field will be generated that contains the old value of the filename in case no new one is specified by the user.
Comments
This is not working.
RE: This is not working.
I agree. I bound the field (control field) from my recordset to the field in the form and uploaded. I accessed my "Edit" page and made a text change to one of my other fields. I did not touch the "Image" field. I pressed "Update Record" and returned to my "Details" page. The image was gone. I downloaded the database (MS Access) and discovered the entire path was erased from that field. I returned to my page in Dreamweaver and removed the PURE ASP UPLOAD 3 and re-added my previous PURE ASP UPLOAD 2.x and re-uploaded. IT WORKS FLAWLESSLY.
Please help!
Shane
<shanefaulkner@adelphia.net>
P.S. I am using Classic ASP with MS Access and DWMX.
You must me logged in to write a comment.