Forums
This topic is locked
FYI PAU3 and SIP2 update with no file selection
Posted 26 Jul 2007 20:41:08
1
has voted
26 Jul 2007 20:41:08 Bill Henderson posted:
Hi,On several update records pages over the last year, I've struggled to get PAU3 and SIP2 to not write over the existing file name in the db if the user doesn't want to re-upload the same file/image, etc.
One article on your site indicates this is done simply by binding the update record's recordset to the file fields in the form but I've never gotten this to work.
Finally, someone else tipped me off that using a db value from the same recordset twice or more in a page usually doesn't work and advised that I assign new variables to each db field I'll use more than once.
On update record pages using PAU3 and SIP2, the first use instance is on the bound file field. The second use is in the hidden variable field:
<input type="hidden" name="upload_org_image1" value="="<%= Recordset4.Fields.Item("Image 1".Value %>" />
What I did instead was to define each of my 5 potential images as new variables on the page:
<%
pic1 = (Recordset4.Fields.Item("Image1".Value)
pic2 = (Recordset4.Fields.Item("Image2".Value)
pic3 = (Recordset4.Fields.Item("Image3".Value)
pic4 = (Recordset4.Fields.Item("Image4".Value)
pic5 = (Recordset4.Fields.Item("Image5".Value)
%>
Then in your code, the bound file field:
<input name="image1" type="file" id="image1" onChange="<%=pau.validateCode()%>;return document.MM_returnValue" value="<%(Recordset4.Fields.Item("Image1".Value)%>" />
...becomes...
<input name="image1" type="file" id="image1" onChange="<%=pau.validateCode()%>;return document.MM_returnValue" value="<%=pic1%>" />
and Eureka - I'm able to reproduce successful results in a way I can't seem to using your code out of the box.
Let me know if this doesn't make sense, but should PAU3 and SIP2 be doing something like this, rather than relying on pulling the same value from the same recordset?
Thanks
Bill
Replies
Replied 02 Aug 2007 14:10:18
02 Aug 2007 14:10:18 Georgi Kralev replied:
Hi Bill,
Check the following thread:
www.dmxzone.com/forum/post.asp?method=Reply&topic_id=39175&forum_id=61&cat_id=1
Regards,
Georgi Kralev
----------------------------------
Support - www.DMXzone.com
Check the following thread:
www.dmxzone.com/forum/post.asp?method=Reply&topic_id=39175&forum_id=61&cat_id=1
Regards,
Georgi Kralev
----------------------------------
Support - www.DMXzone.com