A web DB APP allowing the uploading of a pict

Good afternoon folks,

I am working on a web application (Oldsmobile classified ads), which will allow a user to submit some info to a SQL 7 database. I am trying to add the functionality of allowing the user to upload a picture. I am trying to do this via Visual Interdev 6.0 SP3 running on Windows 2000 SP1. I was easily able to drag the "File Field" component from the HTML Toolbox onto my ASP form. My database has an AdPhoto column of type image. Now I just have to get the insert asp file to put the image into the database in the AdPhoto column.

My problem is I do not know how to format the insertSQL command. The picture is being sent to the DB in the middle of other data, hence the need for the "," at the end of the SQL command.

I have tried:
strInsertSql = strInsertSql + "'" + Request.Form.Item("txtAdPhoto") + "',"
and:
strInsertSql = strInsertSql + Request.Form.Item("txtAdPhoto") + ","

All attempts lead to "the page cannot be displayed" errors in IE with the AdPhoto stuff in the placead.asp and insertad.asp. Removing the photo stuff will allow things to work again but no photos get upload of course.

The page that I am working with is:
http://h004f49086f4a.ne.mediaone.net/oldsads/placead.asp

You can see the source code by viewing source at:
http://h004f49086f4a.ne.mediaone.net/oldsads/placead.txt

The page that is receiving the data from the form is here:
http://h004f49086f4a.ne.mediaone.net/oldsads/insertad.asp

You can see the source code by viewing source at:
http://h004f49086f4a.ne.mediaone.net/oldsads/insertad.txt

Any suggestions? Got a better way? Maybe there is a .dll out there I could use that was written in VB or something? Maybe there is a way I could FTP the user's file to a FTP directory? Show me the light! Thanks in advance!

Rob
rob@thecutlass.com
[1957 byte] By [maytag] at [2007-11-17 13:02:37]
# 1 Re: A web DB APP allowing the uploading of a pict
hey I have got just the thing for you is you are planning to code in ASP.NET.
I have written a article on how to upload files from ASP.NET pages to your server. Its very easy .
Also what you could insert in your database would be the filename of the Picture while this script uploads the actual file from the users computer to ur server .
You can find this tutorial on http://learncsharp.cjb.net go to the ASP.NET section

Saurabh Nandu
mailsaurabhn@webveda.com
http://Learncsharp.cjb.net
saurabhN at 2007-11-10 3:32:20 >
# 2 Re: A web DB APP allowing the uploading of a pict
Good morning!

This script looks great but I cannot get it to work on my server (win2000
server), not sure why. The only thing I changed is the line:
myFile.PostedFile.SaveAs("c:\\inetpub\\wwwroot\\oldsads\\imageupload\\"+newn
m) ;

Which now reflects my upload directory. When I click upload nothing
happens. You can see the page at
http://h004f49086f4a.ne.mediaone.net/oldsads/FileUpload.aspx

My image upload has full access for the IUSR-Servername account and for
guest, etc. Maybe there is something wrong with the permissions still...
hmmm

Any suggestions?

Thanks!
Rob
maytag at 2007-11-10 3:33:20 >
# 3 Re: A web DB APP allowing the uploading of a pict
i checked out yor page .
seems your server does not support ASP.NET
Let me know

Regards
Saurabh Nandu

Saurabh Nandu
mailsaurabhn@webveda.com
http://Learncsharp.cjb.net
saurabhN at 2007-11-10 3:34:21 >
# 4 Re: A web DB APP allowing the uploading of a pict
I really don't know how to tell if it does or not. I know I can run normal ASP pages. Hmm so how do I get my server to support ASP.NET?

Thanks!
Rob
maytag at 2007-11-10 3:35:15 >
# 5 Re: A web DB APP allowing the uploading of a pict
ask your server admin. The server should have installed the DOT.NET Framework.

Saurabh Nandu
mailsaurabhn@webveda.com
http://Learncsharp.cjb.net
saurabhN at 2007-11-10 3:36:17 >
# 6 Re: A web DB APP allowing the uploading of a pict
Oh. Darn. I am the server admin. I have been looking at this site and on the .NET forum. I hope to find something there that tells me how I can install it. Let me know if you have any suggestions!

Thanks!
Rob
maytag at 2007-11-10 3:37:16 >