473,753 Members | 7,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Uploading image in ASP

Parul Bagadia
188 New Member
Hello,
I am making a project in ASP where am embedding VBscript in it.. Its about sth like a social networking site.. Am making it in Microsoft Expression Studio. Here i want to provide user with an option by which he can upload and view his image. my database is Oracle, what am doing is am providing user with an option of browsing; that comes automatically in Express studio.; with input box of type File,.. where you have a button written browse on it and a text box is provided.. I want that value of that path should be stored in table in oracle along with username and path of the file. amd whenecer user enters log ins the site he should be able to see the pic.
What am i getting is name of reciever is getting stored 4 times and path is not being stored even once.
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <%
  4. fname = Request.Form("Text2")
  5.     'Response.write(fname)
  6.  
  7.     Response.write(File1)
  8.     photo= Request.Form("File1")    about = Request.Form("Text3")
  9.     email = Request.Form("Text10")
  10.     place  = Request.Form("Text4")
  11.     uname= Request.Form("Text5")
  12.     gender=Request.Form("Text6")
  13.     relation=Request.Form("Text7")
  14.     looking=Request.Form("Text8")
  15. hobbies=Request.Form("Text9")
  16. age=Request.Form("Text11")
  17.   Username = Session("name")    
  18.     'response.write(Username)
  19.     %><h2>Your profile has been updated successfully!!
  20.     </h2>
  21. <p>Go back to <a href="profile.asp">profile</a>.</p><%
  22. 'Build connection with database
  23.      photo=request.Form("File1")
  24. response.write(photo)
  25. set conn=server.CreateObject("ADODB.connection")
  26.     conn.ConnectionString="Provider=MSDAORA.1;Password=tiger;User ID=scott;Persist Security Info=True"
  27.     conn.open 
  28.  
  29.     set rs = server.CreateObject ("ADODB.Recordset")    
  30.     set rs1 = server.CreateObject ("ADODB.Recordset")
  31.     set rs3 =server.CreateObject ("ADODB.Recordset")
  32. set rs2 = server.CreateObject ("ADODB.Recordset")    
  33. query2="insert into image values('"&photo&"','"&username&"')"
  34. rs2.open query2,conn query="update userdata set fname ='"& fname &"',email='"& email &"',age="& age &",gender='"& gender &"'  where uname= '"&uname &"'  "
  35.  'response.write(query)
  36.  'conn.execute query
  37.   conn.execute "commit"
  38.  'rs.movefirst
  39.  
  40. query1="update profile set about ='"& about &"',place='"& place &"',caption='"& caption &"',relation='"&relation&"',looking='"&looking&"',hobbies='"&hobbies&"' where uname= '"& uname &"'  "
  41. response.write("<br>")
  42. 'response.write(query1)
  43.   conn.execute query1
  44.  conn.execute "commit"  
  45.  'rs1.movefirst
  46.  query3="insert into image values('"&photo&"','"&Username&"')"
  47. rs3.open query3, conn
  48. %>
  49. </body>
  50. </html>
Apr 10 '09 #1
1 2135
jhardman
3,406 Recognized Expert Specialist
Parul,

Check out this article, it doesn't talk about saving it in the db, but does cover the uploading. When you get that done, post again, and I'll see if I can help you with the next step.

Jared
Apr 12 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4471
by: Ralph Freshour | last post by:
I'm trying to code the ability for my users to upload up to photo's to mysql database - can someone point me in the right direction as to how this might be done in php? Perhaps a tutorial or some code samples? My two php books don't cover uploading photo's to a web site. Thanks...
5
17482
by: ok | last post by:
Hello, Q: How do I get image width and height before uploading an image? This because, I want to restrict people uploading huge files. Thanks in advance
7
4000
by: lion | last post by:
I get these errors when uploading images via a web page: (the page still uploads the images but reports these errors?) Warning: fopen(D:\php\uploadtemp\php1FC7.tmp) : failed to create stream: No error in D:\webspace\me.co.uk\wwwroot\test\Live.php on line 105 Warning: Wrong parameter count for filesize() in D:\webspace\me.co.uk\wwwroot\test\Live.php on line 109
10
7404
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't recommend storing the image to the filesystem and only keeping a pointer to that in the table. I want to dump the image to a table. My code dumps the data into the table, however, I get the following error when trying to view the image "the image ......
0
7280
by: Alex | last post by:
my app was working fine in VB.NET 2003 (and framework 1.1). Now with VB.NET 2005 (framework 2.0) the uploading to an http server (ie. www.sharebigfile.com) stops with the error "The request was aborted: The request was canceled" after about 7 MB. For example, I might be uploading a 73MB file. After about 11% done the upload aborts. :shake: It works great for files < 5MB. I can upload those every time.
1
2080
by: wenqiang7 | last post by:
I am encountering a very strang problem with file uploading in my ASP.Net page. When we try to upload certain file, we'll get an error msg of "Cannot find server or DNS Error". We are running on Win2003, IIS, ASP.Net 1.1. The page works fine if running from localhost. It only has problem when accessed from a domain name.
44
9563
by: badvoc | last post by:
Hi to all, Firstly I must state my knowledge of php is limited but I am a quick learner. I have taken on the task of finishing a friends website due to his untimely passing and have hit a problem with the completion of his work. The site involves the uploading of a picture, jpg, png or gif. as part of an order process. The files involved are called order.php, step1.php and then step2.php. The picture uploads to the upload folder,...
1
2076
by: thulaseeram | last post by:
I am using iframe to store uploaded images, it is uploading fine in IE but it is not happening in firefox means first time it is uploading image if i try to upload second image it is not calling even java script function and not uploading the image in firefox. I am using this code in the button onclick event "attach_frame.upload();" here attach_frame is the iframe name and id to which the uploaded image should add. please can any one help me to...
7
4511
by: dasrasmikant | last post by:
Dear Experts, I am falling in a trouble and need your help for solving it I want to get the width and heignt of an image before uploading it. Below is my code <script language="javascript"> function showImage(i) { x=new Image; x.src=i;
1
2127
pezholio
by: pezholio | last post by:
Hi, It seems that every time I put together a new script to upload a file I always have problems, here's the latest one: I've got a form with two file input fields, when I submit the form, everything goes OK, but the files don't upload, the permissions on the folders are fine and dandy (Both 777). Here's my code: if(is_uploaded_file($_FILES)){ $target_path = "/home/default/ratemyplace.org.uk/user/htdocs/newsite/images/premimages/";
0
8896
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9421
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9333
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8328
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2872
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2284
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.