Forums
This topic is locked
Pure ASP Upload, Zero length string problems
Posted 13 Mar 2002 07:53:35
1
has voted
13 Mar 2002 07:53:35 lee chadwick posted:
I am using pure asp upload to upload images to a folder. When I do not upload a page, I want an alternate image to display. I am using the following code:If IsNull(rsArticle.Fields.Item("Image_Blob".Value) = True Or IsEmpty(rsArticle.Fields.Item("Image_Blob".Value) = True Then
Response.Write"<img src=""images/transparent.gif"">"
Else %>
<img src="../../../../database/upload/<%=(rsArticle.Fields.Item("Image_Blob".Value)%>"><% End If %>
This only works if the value in the database is "null". Pure asp upload apparently changes the value to a zero length string when nothing is uploaded to that field. How do I take care of this problem. I want a transparent gif displayed if there is not a file uploaded.
Thanks
Replies
Replied 13 Mar 2002 09:18:16
13 Mar 2002 09:18:16 Viktor Farcic replied:
Try:
<%
If (rsArticle.Fields.Item("Image_Blob".Value <> "" Then
***Code to diplay image***
Else
***Code to diplay alternate image***
End If
%>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I am using pure asp upload to upload images to a folder. When I do not upload a page, I want an alternate image to display. I am using the following code:
If IsNull(rsArticle.Fields.Item("Image_Blob".Value) = True Or IsEmpty(rsArticle.Fields.Item("Image_Blob".Value) = True Then
Response.Write"<img src=""images/transparent.gif"">"
Else %>
<img src="../../../../database/upload/<%=(rsArticle.Fields.Item("Image_Blob".Value)%>"><% End If %>
This only works if the value in the database is "null". Pure asp upload apparently changes the value to a zero length string when nothing is uploaded to that field. How do I take care of this problem. I want a transparent gif displayed if there is not a file uploaded.
Thanks
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
<%
If (rsArticle.Fields.Item("Image_Blob".Value <> "" Then
***Code to diplay image***
Else
***Code to diplay alternate image***
End If
%>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I am using pure asp upload to upload images to a folder. When I do not upload a page, I want an alternate image to display. I am using the following code:
If IsNull(rsArticle.Fields.Item("Image_Blob".Value) = True Or IsEmpty(rsArticle.Fields.Item("Image_Blob".Value) = True Then
Response.Write"<img src=""images/transparent.gif"">"
Else %>
<img src="../../../../database/upload/<%=(rsArticle.Fields.Item("Image_Blob".Value)%>"><% End If %>
This only works if the value in the database is "null". Pure asp upload apparently changes the value to a zero length string when nothing is uploaded to that field. How do I take care of this problem. I want a transparent gif displayed if there is not a file uploaded.
Thanks
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager