Re: upload file into database in asp

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John (jz~~remove~~mcfireAThotmailDOTcom)
Date: 09/08/04


Date: Tue, 7 Sep 2004 19:42:17 -0700

Roland,

Do you have a code sample of how you run the doc file download/edit/upload?
Or is there a link to sample code at MS or elsewhere that you can pass on?
Or even a general description of the process -- e.g. ... use
Response.BinaryWrite for ...

I'm obviously a bit of a beginner at this. I've been looking about the net
for awhile, likely in the wrong places, and haven't been able to find a good
model.

Appreciatively,

John

"Roland Hall" <nobody@nowhere> wrote in message
news:%23742QaTlEHA.3016@tk2msftngp13.phx.gbl...
> "weiwei" wrote in message
> news:d32b0478.0409071339.32df9b4b@posting.google.com...
> : Hi All
> : I want to upload either image or word document into either access or
> : SQL server database
> : so far I am doing some small testings and what I can do is upload the
> : file from first page and display at the next
> : page with (both image or word are working fine).
> : however, I cann't insert them into the database, Plus, what type
> : should I use in access database?
> : anyone who has this type of project, please help me out
> : below is my current test code
> : <%
> : FormSize = Request.TotalBytes
> : FormData = Request.BinaryRead( FormSize )
> : 'bnCRLF = chrB( 13 ) & chrB( 10 )
> : 'Divider = LEFTB( FormData, INSTRB( FormData, bnCRLF ) - 1 )
> : 'DataStart = INSTRB( FormData, bnCRLF & bnCRLF ) + 4
> : 'DataEnd = INSTRB( DataStart + 1, FormData, divider ) - DataStart
> : 'Response.ContentType = "image/gif"
> : 'Response.ContentType = "application/msword"
> : 'Response.BinaryWrite MIDB( FormData, DataStart, DataEnd )
> : 'Response.BinaryWrite FormData
> : %>
> : <!--Create and Open the Databse Connection-->
> : <% Set connCW = Server.CreateObject("ADODB.Connection") %>
> : <% connCW.Open ="Driver={Microsoft Access Driver (*.mdb)}; " &_
> : "DBQ=" & Server.Mappath("track.mdb") %>
> : <%
> : sql = "INSERT INTO upload (FileName) VALUES('" & FormData & "')"
> : Set rs = connCW.Execute(sql)
> : %>
> :
> : I got error saying type mismatch
>
> My upload routines upload the file to the server, I move it to a specific
> location and I store the path and filename in the database. I don't see a
> need to store files in databases.
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>



Relevant Pages

  • Re: inserting images into mysql database using matlab
    ... I would like to know how to insert images into mysql database and how to retrieve and display the inserted images. ... // declare a connection by using Connection interface Connection connection = null; ... /*declare a resultSet that works as a table resulted by execute a specified sql query. ... System.out.println("unsucessfull to upload image."); ...
    (comp.soft-sys.matlab)
  • Re: inserting images into mysql database using matlab
    ... First create database named 'anju' by query given below: ... // declare a connection by using Connection interface ... /* executeUpdate() method execute specified sql query. ... System.out.println("unsucessfull to upload image."); ...
    (comp.soft-sys.matlab)
  • Re: I lose data, when I try to save a loaded DataTable on the click of another button in an asp.net
    ... that allows for the upload of an excel sheet into the database. ... I have an upload button and a save button. ... which is bound to a GridView for previewing before ... protected void Upload_Click(object sender, EventArgs e) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Im about to commit matrimony (now with link)
    ... Keep tweaking the CV and upload new versions if the old ... with Wboserve yesterday, but their upload pages were borked. ... database and run several different filters against it. ... There's still an awful lot of COBOL code around and universities don't teach ...
    (uk.rec.sheds)
  • Re: Can you Upload a file and update a db on 1 form?
    ... You will need to create a form, then submit it to the database, then in the next step in the process ... allow the user to upload a file and then update the record that was created in the first step, ... security update, then there is usually no charge for the call. ... > user to upload a newsletter and update the database with the same form. ...
    (microsoft.public.frontpage.programming)