A web application allowing the uploading of a pict

Results 1 to 5 of 5

Thread: A web application allowing the uploading of a pict

  1. #1
    Rob Guest

    Default A web application allowing the uploading of a pict

    Good afternoon folks,<BR><BR>I am working on a web application, 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.<BR><BR>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.<BR><BR>I have tried:<BR>strInsertSql = strInsertSql + "&#039" + Request.Form.Item("txtAdPhoto") + "&#039,"<BR> and:<BR>strInsertSql = strInsertSql + Request.Form.Item("txtAdPhoto") + ","<BR><BR>All attempts lead to "the page cannot be displayed" errors in IE with the AdPhoto stuff in the placead.asp and insertad.asp. Removing them allow things to work again but no photo.<BR><BR>The page that I am working with is:<BR>http://h004f49086f4a.ne.mediaone.net/oldsads/placead.asp<BR><BR>You can see the source code by viewing source at:<BR>http://h004f49086f4a.ne.mediaone.net/oldsads/placead.txt<BR><BR>The page that is receiving the data from the form is here:<BR>http://h004f49086f4a.ne.mediaone.net/oldsads/insertad.asp<BR><BR>You can see the source code by viewing source at:<BR>http://h004f49086f4a.ne.mediaone.net/oldsads/insertad.txt<BR><BR>Any suggestions? Thanks in advance!<BR>Rob<BR>rob@thecutlass.com

  2. #2
    Join Date
    Dec 1969

    Default RE: A web application allowing the uploading of a

    It&#039s a bit more complicated then that. Images have to handled a bit differently.<BR><BR>Search thru SQL Server Book Online for "image." You should find a lot of info.<BR><BR>Now, why are you trying to put the images in the database? You could work this by storing the name & path to the image in the db instead. It would be faster that way.

  3. #3
    Rob Guest

    Default RE: A web application allowing the uploading of a

    Good evening DeQuincey,<BR><BR>&#062;You could work this by storing the name & path to the image in the db instead. <BR><BR>Thanks for the response. I am unclear what you mean. The reason why I am trying to put the image in the DB is because I am thinking it is the best way. If there is another way, I am all ears. For example, if there was a way that I could upload the file to my web server (not sure how to do that) and then instead of inserting the image in the database, I could somehow put a link to the location of the picture in the database instead, that would be great. But either way, I am not sure how to:<BR>1) Get the file from the user&#039s PC to my web server - assuming this can be done via the File Field in Visual Interdev HTML Toolbox; and<BR>2) Then figure out how to capture the filename into the SQL DB and then get the table entry so that it is pointing to the filename on the web server.<BR><BR>Any suggestions?<BR><BR>Thanks in advance!<BR>Rob

  4. #4
    peterjl@austec.net.au Guest

    Default RE: A web application allowing the uploading of a

    To do the file upload you need to use a component such as AspUpload (http://www.aspupload.com/) or SAFileUP (www.safileup.com). The latter is great and comes with heaps of docs and samples, that cover everything that you would want to do with uploading. I have not tried ASPUpload, but it is very popular. <BR><BR>An important consideration would be your target ISP, as you may be limited to the upload component that they use.<BR><BR>I thnk that storing the images on the filesystem would be more efficient, and that is what "DeQuincey" was trying to say in his reply. That way you only have to worry about the upload.

  5. #5
    Rob Guest

    Default RE: A good solution, & looking for Visual Interdev

    Thanks for the response!<BR><BR>My target is my web server (Win2000, SQL 7) that sits in my location, under my control, so an ISP server should not be an issue. Unless the way the file is sent (via the ISP) to my server is at issue.<BR><BR>I am certainly willing to entertain ANY better ways or suggestions in accomplishing this task. Thanks for all input and to Peter for those links! I checked them out and they look like they will do the job. But I really think that this functionality is included in Visual Interdev 6, which I am using. Anyone know of a Visual Interdev Message Board/Forum like this one?<BR><BR>I guess at this point, whatever works, right?? ;)<BR>Rob<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts