File-Uploading Windows Script Component

Results 1 to 2 of 2

Thread: File-Uploading Windows Script Component

  1. #1
    Join Date
    Dec 1969

    Default File-Uploading Windows Script Component

    Hey Andy, thanks for your help, Although I’m still not out of the woods on being able to change the folder the File-Uploading Windows Script Component uploads the file to. So if you or anybody can help me. <BR><BR>Here’s the example you gave me:<BR>==========================<BR><BR>Dim MyRequest <BR>&#039;&#039; This loads the object <BR>Set MyRequest = GetObject( "script:"& Server.MapPath("/MetaBuilders.FileUp.wsc" ) ) <BR><BR>&#039;&#039;This changes the Save path for all the UploadControls <BR>MyRequst.SavePath = Server.MapPath( "/uploads/" )<BR>===========================<BR><BR>What I couldn’t figure out was where to put this code. I Thought it was in the default.asp page. This is what my code looked like before I added your example. I changed your <BR>Dim MyRequest to Dim MBRequest like it was in the tutorial here on 4guys:<BR>============================<BR><BR>&#06 0;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR>&#060;% response.buffer=true %&#062;<BR>&#060;%<BR>Dim MBRequest<BR>Dim strPath<BR>strPath = "script:" & Server.MapPath("MetaBuilders.FileUp.wsc")<BR>&#039 ;Response.Write strPath<BR>&#039;Response.End<BR>set MBRequest = GetObject( strPath )<BR><BR>If MBRequest("submit") = "upload" then<BR> Response.Write "You Uploaded: " & MBRequest("File1").Path & MBRequest("File1").FileName & "<BR>" & vbNewLine<BR> Response.Write "The Extension Is: " & MBRequest("File1").Extension & "<BR>" & vbNewLine<BR> Response.Write "The MIME/ContentType Is: " & MBRequest("File1").ContentType<BR><BR> &#039;Save the uploaded file to the directory this ASP script resides in<BR> MBRequest("File1").Save<BR><BR>end if<BR>%&#062;<BR>================================= <BR>So am I right to put your example code in the default.asp page. And if so what is it that I may need to change. I played with it for a few hours last weekend and couldn’t get it work. I’d appreciate any help. Thanks dReW<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: File-Uploading Windows Script Component

    Hi,<BR>I too have been using this code and it works very well with me.As for the part of where to put the path to save the file just place it before thr MBrequest("file1").Save .<BR><BR>Just that much and it will do the job.<BR><BR>Regards<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