Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How To Browse for an image file and save it to image server folder

Reply
Thread Tools

How To Browse for an image file and save it to image server folder

 
 
Mike John
Guest
Posts: n/a
 
      07-28-2003
I trying to browse for an image file and save it to the
server image folder.
in other words , upload the picture.

I tried html and aspx.net code:
html:***************************************
<INPUT id="UpLoadFile" style="Z-INDEX: 140; LEFT: 248px;
WIDTH: 87px; POSITION: absolute; TOP: 538px; HEIGHT: 2px"
type="file" onchange="UpLoadFileImage()" size="1"
runat="server">

asp.net:*** Dim hpfIS As HttpPostedFile
hpfIS = UpLoadFile.PostedFile ' uploadfile is the
id of an intput type 'file' that I have created in html

If hpfIS.ContentLength = Nothing Then
Exit Sub
End If

hpfIS.SaveAs(Server.MapPath("images") & "\" &
Me.txtRecID.Text & ".jpeg")
*********************************

but I have receieved an error.
err :

Object reference not set to an instance of an object.
the object in this case is hpfis

please help

sincerely yours

Mike John



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browse to Folder instead of Folder + File Dan ASP .Net 7 10-28-2010 07:39 AM
[ANN] SgfParser 0.8.0 - Open, browse and save! Aldric Giacomoni Ruby 0 01-05-2010 06:19 AM
Assigning value to Browse button without using browse button in HTML balakrishnan.dinesh@gmail.com Javascript 0 10-12-2007 06:45 AM
Browse client Directory to a specific folder and ftp the file from server to client bindu_conacle@yahoo.com ASP .Net 1 02-26-2006 11:34 AM
Internet Explorer 6 Can't Browse, Other Programs Browse Fine... Ike Computer Support 1 08-02-2005 09:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57