Multiple Image Upload Paths

Last post 03-16-2004, 3:06 AM by hsg. 4 replies.
Sort Posts: Previous Next
  •  03-05-2004, 3:04 AM 522

    Multiple Image Upload Paths

    Hi

     

    I was wondering if anyone knew if it was possible to upload an image to two different locations on file upload at the same time?

     

    Using : editor.ImageGalleryPath = ""

     

    Many thanks for any help on this.

  •  03-08-2004, 3:18 PM 527 in reply to 522

    Re: Multiple Image Upload Paths

    You can make changes to filepost.asp to achieve this.

     

    In the line 104 of the filepost.asp, you will find the following code:

     

    ' If your upload path is different, set that here

    filePath = ImageGalleryPath &"/"& fName

    savePath = server.mapPath( filePath)

    set saveFile = lf.createtextfile(savePath, true)

    saveFile.write( myRequestFiles(0, 1))

    saveFile.close

     

    For example, your another imageagllerypath is "secondgallerypath", you can implement the following code:

     

    ' If your upload path is different, set that here

    filePath = ImageGalleryPath &"/"& fName

    savePath = server.mapPath( filePath)

    set saveFile = lf.createtextfile(savePath, true)

    saveFile.write( myRequestFiles(0, 1))

    saveFile.close

     

    secondsavePath = server.mapPath( secondgallerypath)

    set secondsaveFile = lf.createtextfile(secondsavePath, true)

    secondsaveFile .write( myRequestFiles(0, 1))

    secondsaveFile .close

     

     

    let me know if you have any further question.


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-15-2004, 2:31 AM 553 in reply to 527

    Re: Multiple Image Upload Paths

    Thanks, Is it possible to upload to two different servers at the same time? I have tried the above and got that working, but not to a different server.
  •  03-15-2004, 8:50 AM 561 in reply to 553

    Re: Multiple Image Upload Paths

    Hsq,

     

    No, I don't think you can upload the files to two diffent servers at the same time.

     

    I suggest you use the FTP to send the files to the other server. Below is the code I used before to FTP the files in the fly.

     

     

    <%

    Public Function FTP(file_tobe_FTP)

    Dim Output, ReturnCode, StrScript

    StrHost = "xx.xx.xx.xx"

    StrUser = ""

    StrPass = ""

    StrMode = "ascii"

    LocalDir = ""

    RemoteDir = ""

    file_tobe_FTP = server.MapPath(file_tobe_FTP)

    Dim objFSO, strFile, objTempFldr, objFile, objRegExp

    Dim objShell, WSX, strLog, StrErrorLog

    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

    Set objTempFldr = objFSO.GetSpecialFolder(TemporaryFolder)

    strFile = objFSO.GetTempName

    strFile = objTempFldr & strFile &".ftp"

    If not objFSO.FileExists(strFile) then

    objFSO.CreateTextFile(strFile)

    end if

    Set objFile = objFSO.OpenTextFile(strFile,2,true)

    objFile.WriteLine(StrUser)

    objFile.WriteLine(StrPass)

    If LocalDir <> "" Then

    objFile.WriteLine("lcd "& LocalDir)

    End if

    If RemoteDir <> "" Then

    objFile.WriteLine("cd "& RemoteDir)

    End if

    objFile.WriteLine StrMode

    objFile.WriteLine("put "&file_tobe_FTP)

    objFile.WriteLine("bye")

    objFile.close

    Set objShell = Server.CreateObject("WScript.Shell")

    set WSX = objShell.Exec( "ftp.exe -i -s:" & strFile & " " & strHost )

    set ReturnCode = WSX.StdErr

    set Output = WSX.stdOut

    strErrorLog = objTempFldr.Path & "ftpErrors.txt"

    strLog = objTempFldr.Path & "ftpLog.txt"

    Set objFile = objFSO.OpenTextFile( strErrorLog, 2, True )

    objFile.Write( ReturnCode.ReadAll() )

    Set objFile = objFSO.OpenTextFile( strLog, 2, True )

    objFile.Write( Output.ReadAll() )

    objFile.Close()

    'clean up

    objFSO.DeleteFile strFile, True

    set objFSO = nothing

    set objFile = nothing

    End Function

    %>


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-16-2004, 3:06 AM 568 in reply to 561

    Re: Multiple Image Upload Paths

    Many thanks for your help.
View as RSS news feed in XML