mbt masai
 
Welcome !
         

                                
After experiencing a lot of down time, We decided to move this site to CrystalTech.com. CrystalTech.com is powered by only the finest Windows servers providing the best performance, reliability, and value anywhere.

 Upload - Help

Author Message
Tonblz

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 2/19/2010
  • Status: offline
Upload - Help Friday, February 19, 2010 12:54 AM (permalink)
0
I'm having trouble creating a function to upload
 
i have the file name, extension, directory, but does not save, missing some command ?
 
code below
 
 Server.ScriptTimeout = 5400
    EstensoesProibidas=",exe,asp,php,sql,bat,pif,ocx,dll,aspx,shtml,"
    ExtensoesPermitidas="," & ExtensoesPermitidas & ","
 
 strArquivo = request.form("GROB")
 strPath = "C:\Wellington"
 %> <form></form><%
 response.write "directory: " & strPath 
 'Path of the original file
  filepathname = strArquivo
 %> <form></form><%
 response.write "File Location: " & strArquivo 
 'Gets the extension
    For i = Len(filepathname) To 1 Step -1
        If Mid(filepathname, i, 1) = "." Then Exit For
    Next
    extension= Right(filepathname, Len(filepathname) - i)
 %> <form></form><%
 response.write "extension: " & extension
    if ExtensoesPermitidas=",*," then
        pode=(InStr(extensao,EstensoesProibidas)=0)
    else
        pode=(InStr(extensao,EstensoesPermitidas)>0)
    end if
    if pode then
  'Create FileSytemObject Component
        Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
        if not ScriptObject.FolderExists(strPath) then ScriptObject.CreateFolder(strPath)
        filename = ""
        if filename="" then
            For i = Len(filepathname) To 1 Step -1
                If Mid(filepathname, i, 1) = "\" Then Exit For
            Next
            filename = Right(filepathname, Len(filepathname) - i)
        end if
  %> <form></form><%
  response.write "file : " & filename
       'Create and Write to a File (WARNING: Overwrites existing!)
        pathfilename = strPath & "\" & filename
  %> <form></form><%
  response.write "file : " & pathfilename
     Set MyFile = ScriptObject.CreateTextFile(pathfilename,true)
        For i = 1 to LenB(value)
            MyFile.Write chr(AscB(MidB(value,i,1)))
        Next
        MyFile.Close
 end if
#1
    centauricw

    • Total Posts : 42
    • Scores: 2
    • Reward points : 0
    • Joined: 2/20/2006
    • Status: offline
    Re:Upload - Help Friday, June 18, 2010 10:13 PM (permalink)
    0
    ASP is notoriously horrible dealing file uploads and it's always highly recommended that you use a third-party component.  Probably the best known component is Persits Software's ASPUpload, but it's not cheap.  However, component developer Chilkat Software offers a freeware ASP Upload Component.  I use Chilkat components in my own code and these are some of the best components at affordable prices, some of which, like the ASP Upload component, are free.
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.8
      mbt shoes www.wileywilson.com