Ok - This is crazy. It doesn't make sense.

Results 1 to 3 of 3

Thread: Ok - This is crazy. It doesn't make sense.

  1. #1
    Join Date
    Dec 1969

    Default Ok - This is crazy. It doesn't make sense.

    Ok ok, I need to calm down a sec and explain my problem cleary.<BR><BR><BR>I am working with File Upload with ASP. I found a tutorial online.<BR><BR>Let me start off by saying I have everything work ing just fine, no errors, nothing. <BR><BR>I built the form, I built the DB table, and I have tested it numerous times with it working perfectly.<BR><BR>Now that I am ready to add it to my website, I move the files from a folder called "TEST" to a folder called "LIVE"<BR><BR>Keep in mind that both of thiese folders are in the exact same directory.<BR><BR>Here&#039s the thing - when I move it to the NEW folder I get an "Invalid procedure call or argument: &#039MidB&#039 " error. <BR><BR>When I move all the files back to the old folder, once again ti works fine.<BR><BR>Keep in mind that this code has absolutely nothing to do with specifying a directory location. So simply moving the files to a new folder should have no effect on the **** thing. <BR><BR>The code giving me errors is line 6 below:<BR><BR>Please if you can help let me know - I am going insane.<BR><BR>&#060;%<BR>Sub BuildUploadRequest(RequestBin)<BR> &#039Get the boundary<BR> PosBeg = 1<BR> PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))<B R> boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)<BR> boundaryPos = InstrB(1,RequestBin,boundary)<BR> &#039Get all data inside the boundaries<BR> Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))<BR> &#039Members variable of objects are put in a dictionary object<BR> Dim UploadControl<BR> Set UploadControl = CreateObject("Scripting.Dictionary")<BR> &#039Get an object name<BR> Pos = InstrB(BoundaryPos,RequestBin,getByteString("Conte nt-Disposition"))<BR> Pos = InstrB(Pos,RequestBin,getByteString("name="))<BR> PosBeg = Pos+6<BR> PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))<B R> Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))<BR> PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filen ame="))<BR> PosBound = InstrB(PosEnd,RequestBin,boundary)<BR> &#039Test if object is of file type<BR> If PosFile&#060;&#062;0 AND (PosFile&#060;PosBound) Then<BR> &#039Get Filename, content-type and content of file<BR> PosBeg = PosFile + 10<BR> PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))<B R> FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))<BR> &#039Add filename to dictionary object<BR> UploadControl.Add "FileName", FileName<BR> Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))<BR> PosBeg = Pos+14<BR> PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))<B R> &#039Add content-type to dictionary object<BR> ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))<BR> UploadControl.Add "ContentType",ContentType<BR> &#039Get content of object<BR> PosBeg = PosEnd+4<BR> PosEnd = InstrB(PosBeg,RequestBin,boundary)-2<BR> Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg)<BR> Else<BR> &#039Get content of object<BR> Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))<BR> PosBeg = Pos+4<BR> PosEnd = InstrB(PosBeg,RequestBin,boundary)-2<BR> Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))<BR> End If<BR> &#039Add content to dictionary object<BR> UploadControl.Add "Value" , Value <BR> &#039Add dictionary object to main dictionary<BR> UploadRequest.Add name, UploadControl <BR> &#039Loop to next object<BR> BoundaryPos=InstrB(BoundaryPos+LenB(boundary),Requ estBin,boundary)<BR> Loop<BR><BR>End Sub<BR><BR>&#039String to byte string conversion<BR>Function getByteString(StringStr)<BR> For i = 1 to Len(StringStr)<BR> char = Mid(StringStr,i,1)<BR> getByteString = getByteString & chrB(AscB(char))<BR> Next<BR>End Function<BR><BR>&#039Byte string to string conversion<BR>Function getString(StringBin)<BR> getString =""<BR> For intCount = 1 to LenB(StringBin)<BR> getString = getString & chr(AscB(MidB(StringBin,intCount,1))) <BR> Next<BR>End Function<BR>%&#062;<BR><BR>

  2. #2
    BobR Guest

    Default RE: Ok - This is crazy. It doesn't make sense.

    Check the security on your folders or, be lazy and rename the test folder to live and see if it works then. If so, something is different between the two locations.

  3. #3
    Join Date
    Dec 1969

    Default RE: Ok - This is crazy. It doesn't make sense.

    Sometimes when I move things and they don&#039t work, it&#039s because I have included files in the document whose paths need to be changed. That&#039ll mess up the whole thing. Do you have any included files in the document?

Posting Permissions

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