have a problem

Results 1 to 2 of 2

Thread: have a problem

  1. #1
    Join Date
    Dec 1969

    Default have a problem

    Heres what I am trying to do.<BR><BR>BTW the web app is located at http://www.neogenus.com/people<BR><BR>the first page a user comes to will be an &#039;upload picture&#039; page. It will consist of one html &#060;INPUT TYPE="FILE"&#062; tag. Then once the user submits the pic, it uses this script to upload it to the server in a directory called uploads:<BR><BR>&#060;!--#INCLUDE FILE="clsUpload.asp"--&#062;<BR>&#060;%<BR>Dim oUpload<BR>Dim oFile<BR>Dim sFileName<BR>Dim oFSO<BR>Dim sNewData<BR>Dim nLength<BR>Dim bytBinaryData<BR>Dim sPath<BR><BR>Const nForReading = 1<BR>Const nForWriting = 2<BR>Const nForAppending = 8<BR><BR>&#039; grab the uploaded file data<BR>Set oUpload = New clsUpload<BR>Set oFile = oUpload("File1")<BR><BR>&#039; parse the file name<BR>sFileName = oFile.FileName<BR>If Not InStr(sFileName, "\") = 0 Then<BR> sFileName = Mid(sFileName, InStrRev(sFileName, "\") + 1)<BR>End If<BR><BR>sFileNameString = Cstr(sFileName)<BR><BR>&#039; Convert the binary data to Ascii<BR>bytBinaryData = oFile.BinaryData<BR>nLength = LenB(bytBinaryData)<BR>For nIndex = 1 To nLength<BR> sNewData = sNewData & Chr(AscB(MidB(bytBinaryData, nIndex, 1)))<BR>Next<BR><BR>&#039; Save the file to the file system<BR>sPath = Server.MapPath(".Uploads") & "\"<BR>Set oFSO = Server.CreateObject("Scripting.FileSystemObject")< BR>oFSO.OpenTextFile(sPath & sFileName, nForWriting, True).Write sNewData<BR>Set oFSO = Nothing<BR><BR><BR><BR>Set oFile = Nothing<BR>Set oUpload = Nothing<BR><BR>%&#062;<BR><BR>&#060;%<BR>Response. Redirect "infoForm.asp?picname=" & sFileNameString<BR>%&#062;<BR><BR>Now as you can see the second to last lst redirects the user to infoForm.asp, and passes the filename of the pic that they just uploaded across the Query String. This is put into an access database along with all the other info, First name last name age etc. The image name gets put into a field called &#039;ImagePath&#039;<BR><BR>Now the script actually works, but weird things are happening. Like the Description field never gets put into the database(cause it does not output it on the page that outputs all the fields on the database) And when I try to Download the updated version of .mdb file, it says the file is currpted even tho it worked fine before I put it on to the server to be used.<BR><BR>What I think the problem is, is that the data from the picture is getting put into a "text" field. I tried to remedy this problem with this line of code in the upload script:<BR><BR>sFileNameString = Cstr(sFileName)<BR><BR>this takes the parsed file name, and supposedly typcasts it into a string. Well, it still doesnt work. What is weird, is you can add new rows to the DB, you just cant delete or upadte the rows, and it does not show a description, which is also weird. heres the error message when I try to use a script that deletes a row:<BR><BR>ADODB.Recordset error &#039;800a0cb3&#039; <BR><BR>Object or provider is not capable of performing requested operation. <BR><BR>/people/deletePerson.asp, line 18<BR><BR>Any thoughts?

  2. #2
    Join Date
    Dec 1969

    Default Didn't you read my email?

    The description field is being sent on because you didn&#039;t give a *NAME* to the field in the form!<BR><BR>Only NAMED fields are sent to the next page.<BR><BR>And I asked you to resend the DB, but you hadn&#039;t by the time I headed home.<BR><BR>And I told you why I thought you were getting that error on the delete.<BR><BR>If you didn&#039;t get those emails, then email me and I&#039;ll try sending them again.<BR><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