www.webdeveloper.com
Results 1 to 3 of 3

Thread: CopyFile: Path not found

  1. #1
    Join Date
    Apr 2007
    Location
    Italy
    Posts
    104

    CopyFile: Path not found

    Hi to All,

    I have a problem ...

    in my page index.hm I have a field like this:

    <input type="file" id="ip_file" name="ip_file"> in which one can choose a desired file.

    in the page test.asp I recall the path chosen in this way:

    <&#37;@ Language=VBScript %>
    <%
    Option Explicit
    '
    Dim a_ho, i_file, up
    '
    a_ho = Request.ServerVariables("server_name")
    i_file = Request.Form("ip_file")
    '
    Set up=Server.CreateObject("scripting.FileSystemObject")
    up.CopyFile i_file , "\\" & a_ho & "\my_path\"
    set up=nothing
    '
    %>


    for me, that I work on the server, no problem ... the file is copied on the specific path...

    The problem is for the client:
    when the clientopens the page test.asp with intranet IE, the answer is :

    PATH NOT FOUND.

    Is there a way to solve this problem that is realted only to the input i_file !!!

    Thanks in advance !!!

  2. #2
    Join Date
    Oct 2005
    Posts
    9
    Try replacing the path with physical path. You can find physical by following:
    PHP Code:
    request.serverVariables("PATH_TRANSLATED"

  3. #3
    Join Date
    Apr 2007
    Location
    Italy
    Posts
    104
    I have solved the problem in this way:

    I have created a page index.asp:

    <html>
    <head>
    <title>Home Page</title>
    <script type="text/javascript">
    function ri_upload() {
    document.FrontPage_Form1.encoding ="multipart/form-data" ;
    document.FrontPage_Form1.action = "ri_upload.asp"
    document.FrontPage_Form1.submit();
    }
    </script>
    </head>

    <body>
    <form method="POST" name="FrontPage_Form1">

    <br><input type="file" id="ip_file" name="ip_file" size="30"><br><br>

    <button onClick="ri_upload()" style="width:50px;">Save</button>

    </form></body></html>


    then, using the upload of Baol copied and downloaded from Internet,
    I have created a page called ri_upload.asp

    ----- code of ri_upload.asp ------


    <!--#include file="baol_upload.asp"-->

    <%
    Dim oUpload
    '
    Set oUpload = new cUpload
    oUpload.Load
    oUpload.SetPath "."
    oUpload.SaveAll
    Set oUpload=Nothing
    '
    %>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles