Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2004, 04:48 AM
Authorized User
 
Join Date: Mar 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alitoday Send a message via Yahoo to alitoday
Default Picture upload and display code

Can any one send me technique/code(ASP) to upload a picture and display in web page,actually i want that user can upload their pictures to my website and me website can display it dynamically

ali
__________________
ali
 
Old June 4th, 2004, 04:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Ali,

For upload, you can check out this URL.

http://www.lewismoten.com/CodeLibrary/Browse/ASP/[All]/1.htm

For display, I am not sure what you mean by "display it dynamically". Can you post a bit clearer on how you want it to work?

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 4th, 2004, 04:59 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

I use AspJpeg and that seems to work pretty good.

 
Old June 5th, 2004, 01:57 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You can check the following article to upload /view images :

http://www.codeproject.com/useritems..._from_Data.asp

Om Prakash
 
Old June 5th, 2004, 04:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

But storing images in access db as that URL specifies, would cost you lot of HDD space. You got to be careful about that, if you are not gonna store lesser number of images. Also I believe that access has a limitation of growing upto 1 GB, not more than that.

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old May 14th, 2005, 07:02 PM
Registered User
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I've got my db and I can display the images in an ASP page, so you can see the price of a peoduct as well as the image but the question here is: in case I have no image for a product it displays an empty box, how can I avoivd showing it.

 
Old May 17th, 2005, 01:37 AM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default

Just write a control structure to handle no image

eg.
<%
' Check the length of the image
If Len(objRS("product_image") > 0 Then
' we have an image and run code for displaying image
%>
<img src="images/<%= objRS("product_image") %>" width="x" height="x">
<%
Else
' no image so display image placeholder or non at all
%>
<img src="images/noimage.gif" width="x" height="x">
<% End If %>

TDA
 
Old May 17th, 2005, 03:43 PM
Registered User
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks TDA for your trying but I got this error message

Expected ')'

on this line

If Len(objRS("product_image") > 0 Then
 
Old May 17th, 2005, 06:48 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

As the error says you are missing a ) - for every ( there must be a )

If Len(objRS("product_image")) > 0 Then

Wind is your friend
Matt
 
Old May 20th, 2005, 03:36 AM
Registered User
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, Mat41 that's right .. I know that, but sometimes we got stupid ! Thanks to remind me.
;)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Display picture from database using JSP codes ban_gal Java Databases 6 May 30th, 2008 08:21 PM
Picture display Venkatesan General .NET 2 January 31st, 2007 08:27 AM
Upload picture Mitch PHP How-To 1 June 5th, 2006 08:54 AM
How to display a picture stored in SqlServer yiyufeiyang BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 March 27th, 2006 10:14 PM
How to upload a picture grstad Classic ASP Databases 5 February 28th, 2006 02:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.