Forums

ASP

This topic is locked

Need help with PureAsp update delete images

Posted 24 Feb 2003 14:17:40
1
has voted
24 Feb 2003 14:17:40 arlie hammons posted:
I am trying to replace or delete an image. Thanks to Wanye's tutorial I am able to replace and delete images. The problem is setting the databse field to null.

I added Wanye code to toggle skip empty fields off but I can only get it working with one image, it delete the one image and set all the "photo" database fields to null.

Here are the code snippets.
if UploadFormRequest("delete_photo1" = "" then
MM_columnsStr = FixColumnsForUpload(MM_fieldsStr,MM_columnsStr)
MM_fieldsStr = FixFieldsForUpload(MM_fieldsStr,MM_columnsStr)
end if
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"

When I add the other delelte_photos t the string it does not work at all.

If UploadFormRequest("photo1" <> "" or UploadFormRequest("delete_photo1" <> ""then
Set File = CreateObject("Scripting.FileSystemObject"
ImagePath=Server.MapPath("..\propertyphotos"
ImagePath=ImagePath & "\" & (rs_modifyalisting.Fields.Item("photo1".Value)
If fileExists(ImagePath) Then
File.DeleteFile(ImagePath)
End IF

This works aside from setting the database field to null.

What am I missing?

Thanks for your help.

Arlie, newbie here

<pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code>

Reply to this topic