You are on page 1of 29

Cookie Policy

Like every other website we use cookies. By using our site you acknowledge that you have read and
understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more

Got it!Allow cookies

Sign up for our free weekly Web Dev Newsletter.

13,830,130 members

Sign in

Top of Form

MenuBarForm

Email

Password

true Sign in

Forgot your password?

Bottom of Form

Sign in with

<a href="https://pubads.g.doubleclick.net/gampad/jump?iu=/6839/lqm.codeproject.site/Web-
Development/ASP/Howto&sz=728x90&c=822117"><img
src="https://pubads.g.doubleclick.net/gampad/jump?iu=/6839/lqm.codeproject.site/Web-
Development/ASP/Howto&sz=728x90&c=822117" width="728px" height="90px"
target="_blank"/></a>

Top of Form
Search within:

Articles

Quick Answers

Messages

Bottom of Form

home

articles

Chapters and Sections>

Latest Articles

Top Articles

Posting/Update Guidelines

Article Help Forum

Submit an article or tip

Post your Blog

quick answersQ&A

Ask a Question about this article

Ask a Question

View Unanswered Questions

View All Questions

View C# questions

View ASP.NET questions

View VB.NET questions

View Java questions

View SQL questions

discussionsforums

All Message Boards...

Application Lifecycle>
Running a Business

Sales / Marketing

Collaboration / Beta Testing

Work Issues

Design and Architecture

ASP.NET

JavaScript

C / C++ / MFC>

ATL / WTL / STL

Managed C++/CLI

C#

Free Tools

Objective-C and Swif

Database

Hardware & Devices>

System Admin

Hosting and Servers

Java

Linux Programming

.NET Framework

Android

iOS

Mobile

SharePoint

Silverlight / WPF

Visual Basic

Web Development

Site Bugs / Suggestions

Spam and Abuse Watch

featuresstuf
Competitions

News

The Insider Newsletter

The Daily Build Newsletter

Newsletter archive

Surveys

Product Showcase

Research Library

CodeProject Stuf

communitylounge

Who's Who

Most Valuable Professionals

The Lounge

Where I Am: Member Photos

The Insider News

The Weird & The Wonderful

The Soapbox

Press Releases

Non-English Language >

General Indian Topics

General Chinese Topics

help?

What is 'CodeProject'?

General FAQ

Ask a Question

Bugs and Suggestions

Article Help Forum

Site Map

Advertise with us
About our Advertising

Employment Opportunities

About Us

Articles » Web Development » ASP » Howto

bookmark this (You'll need to be logged in first)

Print

Articl Top of Form <a


e href="https://pubads.g.doubleclick.net/gam
Kv470Iz3nm5to32
pad/jump?
Brows
iu=/6839/lqm.codeproject.site/Web-
e 10C1FD69
Development/ASP/Howto&sz=160x200&c=4
Code
Display Images from Database in ASP 46207"><img
Stats src="https://pubads.g.doubleclick.net/gamp
Om Prakash Pant, 30 May 2004 ad/jump?
Revisi iu=/6839/lqm.codeproject.site/Web-
ons Development/ASP/Howto&sz=160x200&c=4
4.44 (40 votes)
Altern 46207" width="160px" height="200px"
atives target="_blank"/></a>

Com <a
ment href="https://pubads.g.doubleclick.net/gam
s (52) pad/jump?
iu=/6839/lqm.codeproject.site/Web-
Add 1 2 3 4 5 Development/ASP/Howto&sz=160x600&c=4
your 46207"><img
own 4.44/5 - 40 votes src="https://pubads.g.doubleclick.net/gamp
altern ad/jump?
1 removed
ative iu=/6839/lqm.codeproject.site/Web-
versio μ 4.37, σa 1.43 [?] Development/ASP/Howto&sz=160x600&c=4
n 46207" width="160px" height="600px"
Tagge target="_blank"/></a>
Rate
d as vote 1vote 2vote 3vote
Vote!
Go to top
this:
Win2 4vote 5
K
Win2 Please Sign up or sign in to vote.
003
This article describes how to display images
ASP which are stored in database in either SQL Server
or MS Access.
Wind
ows Download source code - 2.2 Kb

Visual Introduction
-
This article describes how to display images
Studi
which are stored in a database. You can use
o
<IMG> tag to display images stored in the
Stats database by calling another ASP page in SRC
attribute of <IMG> tag.
400.4
K For example:
views
Hide Copy Code
6.1K
<IMG SRC="ShowPicture.asp?PhotoId=1">
down
loads where PhotoId is the ID stored in the database.

51 Using the code


book
mark Following are the steps which needs to be
ed executed:

Poste Create table Users in MS-Access or SQL server.


d 30 Create ShowPicture.asp page.
May
2004 Call this page using <IMG> tag wherever required.

Licen Create table with the following structure:


ced Table name: Users

user_id (AutoNumber)

user_name (Text)

user_photo (Ole Object - For MS-Access, and


Image data type for SQL server).

Code

ShowPicture.asp is used to display images. You


need to pass user ID in querystring, and for that
user ID, image will be displayed. Following is the
code:

Hide Shrink Copy Code

'Declare Variables..
Dim sql

Dim rs

Dim conn

Dim userID,str

userID = Request("PhotoId")

If userID = "" Then userID = 0

'Instantiate Objects

Set conn =
Server.CreateObject("ADODB.Connection")

Set rs =
Server.CreateObject("ADODB.Recordset")

'Open connection

Conn.Open "Provider=Microsof.Jet.OLEDB.4.0;"
&_

"Data Source=" &


Server.MapPath("data.mdb")

'Get the specific image based on the ID passed


in a querystring

str = "SELECT user_photo FROM users where


user_id =" & userID

rs.Open str, conn,3,3

if rs.eof then 'No records found

Response.End

else 'Display the contents

Response.ContentType = "image/gif"

Response.BinaryWrite(rs("user_photo"))

end if

'destroy the variables.


rs.Close

conn.Close

set rs = Nothing

set conn = Nothing

Please note that "Response.contentType" will


depend on the type of content you would like to
display. For example, to display jpg image,
following will be the code:

Hide Copy Code

Response.ContentType = "image/jpg"

To use above page for displaying images,


following is the example:

Hide Copy Code

<IMG SRC="ShowPicture.asp?PhotoId=1">

<IMG SRC="ShowPicture.asp?PhotoId=2">

Upload Image

Following example shows how to upload images


in database by using ASPSmartUpload
component. More information about this
component can be found here.

Following is the code to upload image:

Hide Copy Code

<FORM METHOD="POST" ACTION="saveFile.asp"

ENCTYPE="multipart/form-data"
NAME="UploadForm">

<center>

Employee Name : <INPUT TYPE="TEXT"


NAME="USERNAME" SIZE="30"><br>

<INPUT TYPE="FILE" NAME="UPLOADFILE1"


SIZE="50">

</center>

<BR>

<center><INPUT TYPE="SUBMIT"
VALUE="Upload"
id=SUBMIT1 name=SUBMIT1></center>

</FORM>

Code to save the image in the database:

Hide Shrink Copy Code

Dim myupload

'declare variables..

intCount=0

' Create Upload Component

Set myupload =
Server.CreateObject("aspSmartUpload.SmartUplo
ad")

myupload.Upload

'Create Connection

Set Conn =
Server.CreateObject("ADODB.Connection")

Conn.Open
"Provider=Microsof.Jet.OLEDB.4.0;" & _

"Data Source=" &


Server.MapPath("data.mdb")

Set Rs =
Server.CreateObject("ADODB.recordset")

Rs.Open "SELECT
user_id,user_name,user_photo FROM users",
Conn,3,3

'Select each file

For each file In myupload.Files

If not file.IsMissing Then 'Check for missing


file

'Add the current file in database


Rs.AddNew

file.FileToField Rs.Fields("user_photo")

Rs("user_name") =
myupload.Form("USERNAME")

Rs.Update

intCount = intCount + 1

End If

Next

Response.Write(intCount & " file(s) uploaded.")

'Destroy the objects...

Comments

It is always better to store images in the file


system rather than storing in the database. Only
image path can be stored in the database.
However, storing images in the database depends
on requirements and needs.

<a
href="https://pubads.g.doubleclick.net/gampad/j
ump?iu=/6839/lqm.codeproject.site/Web-
Development/ASP/Howto&sz=300x250&c=82211
7"><img
src="https://pubads.g.doubleclick.net/gampad/ju
mp?iu=/6839/lqm.codeproject.site/Web-
Development/ASP/Howto&sz=300x250&c=82211
7" width="300px" height="250px"
target="_blank"/></a>

License

This article has no explicit license attached to it


but may contain usage terms in the article text or
the download files themselves. If in doubt please
contact the author via the discussion board
below.

A list of licenses authors might use can be found


here

Share

twitter

facebook
linkedin

reddit

google+

About the Author

Om Prakash Pant

Web Developer

India

No Biography provided

Bottom of Form

<a
href="https://pubads.g.doubleclick.net/gampad/j
ump?iu=/6839/lqm.codeproject.site/Web-
Development/ASP/Howto&sz=728x90&c=822117
"><img
src="https://pubads.g.doubleclick.net/gampad/ju
mp?iu=/6839/lqm.codeproject.site/Web-
Development/ASP/Howto&sz=728x90&c=822117
" width="728px" height="90px"
target="_blank"/></a>

You may also be interested in...

Auto-bind byte[] to Entity Framework Core


asp:Image 2 for Enterprise

Display image in Display records in a


asp:HyperLinkField of table using ASP
GridView

Rodney - A Long Time


Coming Autonomous ADO Recordset Paging
Robot (Part 3) in ASP

Comments and Discussions

You must Sign In to use this message board.

Top of Form

55368 fm

Bottom of Form

Top of Form

55368 fid=55368&floc=%

/Articles/7246/Ar Relaxed
Spacing Layout
Open All 25
Per page
Update

Bottom of Form

First PrevNext

displaying images in
an access database 14-Dec-
using asp Member
18
14058174
Member 1405817414- 12:14
Dec-18 12:14

downloaded this sample codes. only


diference is I created the user table with
access eye and saved it as access 2000 file
format mdb. when run example.asp no image
displayed yet when hardcode img in
example.asp image is displayed. could the
problem be due to incompatible with access
rut?
Cannot get it to display the images. please
help

modified 6-Jan-19 12:37pm.

Sign In·View Thread

My vote of 4

Manoj Kumar Manoj Kumar 21-Jan-


Choubey21-Jan-12 Choubey 12 7:06
7:06

I will give you 4


Sign In·View Thread

"Error" Invalid class


string [modified] 11-Jun-
wahed2102
wahed210211-Jun-11 11 15:53
15:53

When i am uploading the following error is


displayed.

Technical Information (for support personnel)

Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/Test/pp_details.asp, line 22

22 Set myupload =
Server.CreateObject("aspSmartUpload.SmartUplo
ad")
23 myupload.Upload

I think that the above object is not being created.

Please help.............

modified on Sunday, June 12, 2011 3:39 AM

Sign In·View Thread

I want to do this but with


I modified the code a little to connect to the
database using ACE OLE DB but and it
connects but the image does not display.

Here is the modified code:

<%
'Declare Variables
Dim sql
Dim rs
Dim conn
Dim RecordId,str

RecordId = Request("MyId")
If RecordId = "" Then RecordId = 1

'Response.Write("RecordId: " & RecordId & "


<br>")
'Instantiate Objects
Set conn =
Server.CreateObject("ADODB.Connection")
Set rs =
Server.CreateObject("ADODB.Recordset")

'Open connection
Conn.Open
"Provider=Microsof.ACE.OLEDB.12.0;Data
Source=F:\HMA Student
Database\StudentDB.accdr;"

'Response.Write("connection open <br>")


'Get the specific image based on the ID passed
in a querystring
str = "SELECT * FROM students WHERE id = "
& RecordId
Set rs=conn.Execute(str)
'Response.Write("rs open <br>")
if rs.eof then 'No records found
Response.Write("no recodes found <br>")
Response.End
else 'Display the contents
'Response.Write("recodes found <br>")
'Response.Write(rs("Attachments"))
Response.ContentType = "image/jpg"
Response.BinaryWrite(rs("Attachments"))
end if

'destroy the variables.


rs.Close
conn.Close
set rs = Nothing
set conn = Nothing
%>

When I run it I get this box, "Do you want to


open or save this file?", instead of showing me
the image. If I select open it gives me the
name but no picture. I have googled many
areas and have found nothing. Any words of
of advice?

Thanks,

Scott

Sign In·View Thread

My vote of 5
Member 12-Feb-
Member 204452912- 2044529 11 1:40
Feb-11 1:40

good article
Sign In·View Thread

My vote of 4 8-Aug-
codemoreforless8- codemoreforless 10
Aug-10 11:50 11:50

Good Code and straightforward for a biginner


level. Only requires admin login script.
Sign In·View Thread

RbmBinaryImage
26-Apr-09
rmostafa26-Apr-09 rmostafa
22:49
22:49

The RbmBinaryImage control will help you


display images directly from your database.
You could bind the Image field directly to the
ImageContent property, also you could specify
whether you want the display to be as a
thumbnail or not and provide the thumbnail
size.
to get it go to http://www.ramymostafa.com/?
p=187

Regards
Ramy Mostafa
Sign In·View Thread

I want to store the


checkboxs and textboxs 29-Oct-
values in database - asp shivasusan 08
shivasusan29-Oct-08 23:28
23:28

Hi!

I am new for asp.

In one form i have multiple check boxes and


textboxes.

for ex:
1 row: "checkbox" Car "textbox" Red color
2 row: "checkbox" Car "textbox" Yellow color
3 row: "checkbox" Bicycle "textbox" Green
color
4 row: "checkbox" Scooter "textbox" Red and
white color
5 row: "checkbox" Bicycle "textbox" Black
color

Now i select 2 checkboxs (1st row checkbox


and 4th row checkbox).
i want to pass the 1st row checkbox and
textbox value (Car, Red color) and 4th row
checkbox and textbox value(Scooter, Red and
white color) pass into database. How? I didn't
want to store the remining checkboxs and
textboxs value. I want to store the selected
rows checkbox and textbox value.

please help me.... It's very very urgent


work.....
Sign In·View Thread

Message Closed
mayurmv 5-Sep-08 18:24
5-Sep-08 18:24
Message Closed
I want Code for serch
data statewise from all
state 4-May-08
influxsam
21:30
influxsam4-May-08
21:30

sahayogi id
name
State
City
500313285
Bhabesh Chandra Deka
Assam
HAILAKANDI
500361131
Rejia Khanam Laskar
Assam
Hailakandi
500304202
Anamika Sinha
Assam
Panchgram
500163536
Panchali Dutta
Assam
panchgram
500224724
Allied agencies
Assam
SILCHAR
500296411
Anjan Shee
Assam
Silchar
500150836
Deblina Partha Deb
Assam
Silchar
500321819
Gitika Nath
Assam
Silchar
500156429
Jaruk Ahmed Choudhury
Assam
Silchar
500229499
Ramesh Chhetri
Assam
Silchar
500125807
Ranbir Kar
Assam
Silchar
500228951
Susmita Naha
Assam
Silchar
500021734
Arun Sahu
Chhatisgarh
MAHASAMUND
Sign In·View Thread

Access 2007/SQL Express


2005 and viewing images 16-Apr-
from ASP Jstncase
08 10:10
Jstncase16-Apr-08 10:10

I have tried this code which is very simple and


to the point. Yet in every efort with Access
2007, all I receive is an icon for the image or a
blank screen where the image is supposed to
appear. I have confirmed proper connection to
the DB as I am pulling information from other
tables.

Is there anything else or an update required to


have this properly working for me? My test
environment is IIS7/Vista Ultimate. All files
have been placed in the wwwroot directory as
I had permission problems putting them in
other places.

I am not concerned with uploading at the


moment, only properly viewing them.
Sign In·View Thread

Re: Access 2007/SQL


5-Apr-11
Express 2005 and Scottsr
15:25
viewing images from ASP
Scottsr5-Apr-11 15:25

Jstncase,

Did you ever get the answer to this? I


tried it with Access 2007 with a .JPG file
in an Attachment field and recieved the
exact same results you did. Can you
help me?

Thanks,

Scott

Sign In·View Thread

Thanks
10-Feb-08
drweb8610-Feb-08 drweb86
22:54
22:54

Thank you very much for simple and short but


clear explanation!
Sign In·View Thread

Hi Can you suggest how to


Upload Images in ASP.NET 29-May-
kodalis
07 6:59
kodalis29-May-07 6:59

Hi Can some one of you suggest me how to


Upload Images to Local Drive and then display
those images in Web Pages in ASP.NET (I am
Using SQL Server for Database and C# for
Code Behind)

Appreciated,
Srikanth..
Sign In·View Thread

Re: Hi Can you suggest Bilal 1-Aug-


how to Upload Images Haider 07 5:22
in ASP.NET

Bilal Haider1-Aug-07
5:22

Hi,

I also need the code for uploading and


downloading images.

i m using ASP.NET (2.0), C# and SQL


2000.

Regards,

Bilal

Sign In·View Thread

Re: Hi Can you suggest


how to Upload Images in 1-Dec-09
ASP.NET tfzwgd
17:44
tfzwgd1-Dec-09 17:44

string fType =
FileUpload_AdPicture.PostedFile.ContentType;
if (fType == "image/pjpeg" || fType ==
"image/bmp" || fType == "image/gif")
{
FileInfo file = new
FileInfo(FileUpload_AdPicture.PostedFile.FileN
ame);
string tempstring = file.Extension;
string filename = "ImageAd" +
DateTime.Now.ToString("yyyyMMddhhmmssff
") + tempstring;
filepath = "Upload/" + filename;
try
{
FileUpload_AdPicture.SaveAs(Server.MapPath(
filepath));
}
catch (Exception ex)
{
Response.Write(ex.Message);
return;
}
}

Sign In·View Thread

No duplicate files
10-May-07
dlbdennis10-May-07 dlbdennis
18:49
18:49

How would I change this code to have


aspsmartupload auto rename any duplicate
images I upload? Like adding a -1, -2 or a (1),
(2) ect to the end of the filename like this
image-1.gif or image(1).gif and so on.
Sign In·View Thread

how to put flash


pgms 18-Feb-07
kshyju
kshyju18-Feb-07 20:42
20:42

how to put /upload flash pgms(8.fls) ?,in an


ASP Application

ThankYOu

Sign In·View Thread

.jpg images from access


database displayed as
garble Member 9-Feb-
3812046 07 4:18
Member 38120469-Feb-
07 4:18

I am trying to display a photo stored in my


access(Microsof office Pro 2003) database
but the page is displaying garble(weird text
symbols and numbers). It looks like it is
reading the image incorrectly. I have put in the
following code as it is a .jpg image.

Response.ContentType = "image/jpg"
The image is stored on a database that is in
the same folder as the image and the .asp
page.
Sign In·View Thread

Display all images


14-Dec-06
brtakaram14-Dec-06 brtakaram
1:24
1:24

Hello Guys I'm brasilian and I like now how do


i make to display all images, because I'm make
a site ecommerce and need display all images
in my sql
Thanks a lot !
Márcio
Sign In·View Thread 5.00/5 (4 votes)

Re: Display all


images 19-Dec-06
brtakaram
brtakaram19-Dec- 7:48
06 7:48

Please anybory help me !!!


Márcio

Sign In·View Thread

Display image along


with text 18-Oct-
tonyg2smith
tonyg2smith18-Oct- 06 7:02
06 7:02

Hello all,

I'm stuck with a stupid error, having spent the last


few hours looking for an answer and not finding
one I am hoping that maybe someone here will
have a solution for me!

Problem is, I can display an image on an .aspx


page, using the following;

Response.BinaryWrite(row("empPhoto"))

When this line is included in my code, it ONLY


displays the image and no the other tables, text
etc that is on the page. No idea why, maybe
someone else has come across this and can
provide a workaround.

Or maybe someone can suggest a way of


displaying an image from the database on a page
along with text, maybe the response.binarywrite
method isn't the best way of going about this.

I would really appreciate any help someone could


provide me with for this.

Thanks in advance,

Tony

Dim ID As String
ID = Request.QueryString("ID")

Dim strConnString As String


strConnString =
ConfigurationManager.ConnectionStrings("SqlCon
nect").ConnectionString

Dim myConnection As New


SqlConnection(strConnString)
Dim sql As String = "SELECT * FROM Employee
WHERE empID = @empID"
Dim cmd As New SqlCommand(sql,
myConnection)

cmd.Parameters.AddWithValue("@empID", ID)

myConnection.Open()

Dim adapt As New SqlDataAdapter(cmd)


Dim table As New Data.DataTable

adapt.Fill(table)

Dim row As Data.DataRow


For Each row In table.Rows

Response.BinaryWrite(row("empPhoto"))

Dim empID As String = (row("empID"))


lblID.Text = empID
Dim empName As String = (row("empName"))
lblName.Text = empName
lblName.Visible = True
Dim empPhoto As Byte()
empPhoto = (row("empPhoto"))
imgPhoto.EnableViewState = True
Next

myConnection.Close()
Sign In·View Thread

Re: Display image 20-


along with text Feb-
rameshkumarp
rameshkumarp20- 07
Feb-07 4:15 4:15

hi,
pls some one respond ........

this is not reg. to this thread.

iam new to asp..


I need a soln to display img from db using asp.

I hv checked the download given by om


prakash in other thread.

It is not working in my sys.


my sys enviornment is win 2003 server and iis
6.0

i feel the err. may be in my html file, coz asp file


is same as given by prakash

any specific meta tag is to be provided in html


file ?
kindly throw some light...

below is my asp code:

<%@ Language= vbscript %>


<%@ Option Explicit %>

<%
' Clear out the existing HTTP header
information
Response.Expires = 0
Response.Bufer = TRUE
Response.Clear

' Change the HTTP header to reflect that an


image is being passed.
Response.ContentType = "image/jpg"

%>

<%
Dim vAppRefNo
vAppRefNo =
Request.QueryString("AppRefNo")

Dim vImage
vImage = Request.QueryString("Image")
%>

<!-- Database Transaction -->


<%
Dim IsImgAvailable
Dim PicSize
Dim cn,rs
Dim path2DB
path2DB=Server.Mappath("Database\ceep.md
b")

Set cn =
Server.CreateObject("ADODB.Connection")
'cn.CursorLocation = adUseClient
Set rs =
Server.CreateObject("ADODB.Recordset")

cn.Open "Provider=MICROSOFT.JET.OLEDB.4.0;
Data Source=" & path2DB &""
'Client Data Retrieval
'dim clnt
'for each k in Request.ServerVariables
' clnt = clnt & k & "=" &
Request.ServerVariables("k") & "
" & vbcrlf
'next
'Response.Write clnt
'clnt=Request.ServerVariables("remote_addr")

if rs.State = 1 then rs.Close

if vImage ="photo" then


rs.Open "select * from PHOTO WHERE
APPREF='" & vAppRefNo & "'",cn ,3,3
end if

if vImage ="signature" then


rs.Open "select * from SIGNATURE WHERE
APPREF='" & vAppRefNo & "'",cn ,3,3
end if

If Not rs.Eof Then


' PicSize = rs("FILE").ActualSize
' if PicSize > 0 then
' Write the Image Data to the client.
Response.ContentType = "image/jpg"
Response.BinaryWrite(rs("FILE"))'.GetChunk(rs(
"FILE").ActualSize))
'Response.End

Else
Response.End
IsImgAvailable = "1" '1 - false case

End If

'DeAllocate Resources
if rs.State = 1 then rs.Close
if cn.State = 1 then cn.Close
Set rs = Nothing
Set cn = Nothing
%>

<!-- Database Transaction -->


Sign In·View Thread

Re: Display image 23-


along with text Feb-
tonyg2smith
tonyg2smith23- 07
Feb-07 4:42 4:42

Where exactly is your code to get the


image from the database and display
it on the page?
Try using the response.binarywrite
method to display the image. I used
that method and have it working.

Sign In·View Thread

Unable to Upload Image


with aspSmartUpload 16-
component [modified] asprajeshOct-06
1:13
asprajesh16-Oct-06 1:13

Hi all ..I m using a code in article "Display Images


from Database in ASP"..But that code insert
everything in tables ..but In image column its
filled Null Value..

My code is Below..
****************************************
****************
Dim myupload
'declare variables..
intCount=0

' Create Upload Component


Set myupload =
Server.CreateObject("aspSmartUpload.SmartUplo
ad")
myupload.Upload

'Create Connection
Set Conn =
Server.CreateObject("ADODB.Connection")
Conn.Open
"Provider=Microsof.Jet.OLEDB.4.0;"& _
' "Data Source=" Server.MapPath("data.mdb")

Set Rs = Server.CreateObject("ADODB.recordset")
Rs.Open "SELECT user_id,user_name,user_photo
FROM users", ConnData,3,3

'Select each file


For each file In myupload.Files
If not file.IsMissing Then 'Check for missing file
'Add the current file in database
Rs.AddNew
file.FileToField Rs.Fields("user_photo")
Rs("user_name") =
myupload.Form("USERNAME")
Rs.Update
intCount = intCount + 1
End If
Next
Response.Write(intCount &" file(s) uploaded.")
'Destroy the objects...
%>
****************************************
*****************

Tell me why above code insert NULL value Instead


of Image ..in data base....
My user_photo Column Having Image datatype

thankyou in Advance..

-- modified at 6:25 Monday 16th October, 2006

Life is not easy ,let's make it.

Sign In·View Thread

Last Visit: 17-Jan-19 2:23 /Articles/7246/Ar


Refresh
Last Update: 17-Jan-19 2:26 123 Next »

General News Suggestion


Question Bug Answer Joke
Praise Rant Admin
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web05 | 2.8.190114.1 | Last Updated 31 May 2004

Select Language ▼

Article Copyright 2004 by Om Prakash Pant


Everything else Copyright © CodeProject, 1999-2019

Layout: fixed | fluid

Original text

Contribute a better translation

You might also like