how can i change filename after upload

Last post 08-16-2012, 8:46 AM by Kenneth. 2 replies.
Sort Posts: Previous Next
  •  08-15-2012, 8:49 PM 74425

    how can i change filename after upload

    i bought aspuploader today but i have problem with changing file names,
     
    our clients uploading to large files around 100 mb - 1500 mb ( tested with 1,4 gb file works fine thank you)
     
    if i do filename change with FileSystem object it takes 15-25 second to complete name change,
     
    how can i change filenames while aspuploader generating files in main directory ?
     
    ps : ah my english not well sorry for about that 
  •  08-15-2012, 9:48 PM 74426 in reply to 74425

    Re: how can i change filename after upload

    i have other problem to :S
     
    when i give costum path TempDirectory method, it works without problem,
     
    uploader.TempDirectory="D:\sites\mysite.com\httpdocs\ordertemp"  
     
    but when i try to give costum path SaveDirectory method, its not working
     
    uploader.SaveDirectory="D:\sites\mysite.com\httpdocs\orders" 
     
     
     
     
    how can i give costum path ? please help me 
  •  08-16-2012, 8:46 AM 74440 in reply to 74426

    Re: how can i change filename after upload

    Hi kambak,
     
    1. you can handle the upload file name by method "CopyTo". The example page below shows you how to handle the upload file store location and the new file name.
     
     
    <%@ Language="VBScript" %>
    <!-- #include file="aspuploader/include_aspuploader.asp" -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>
    Form - Single File Upload
    </title>
    </head>
    <body>
    <div class="demo">
                            
            <h2>Single File Upload</h2>
    <p> A basic sample demonstrating the use of the Upload control.</p>
    <!-- do not need enctype="multipart/form-data" -->
    <form id="form1" method="POST">
    <%
    Dim uploader
    Set uploader=new AspUploader
    uploader.MaxSizeKB=10240
    uploader.Name="myuploader"
    uploader.InsertText="Upload File (Max 10M)"
    uploader.MultipleFilesUpload=true
    %>
    <%=uploader.GetString() %>
    </form>
    <br/><br/>
    <%
    If Request.Form("myuploader")&""<>"" Then
    Dim mvcfile
    Set mvcfile=uploader.GetUploadedFile(Request.Form("myuploader"))
        mvcfile.CopyTo("C:\inetpub\wwwroot\aspuploader\test\"+"newfilename.jpg")
    End If
    %>
    </div>
    </body>
    </html>
     
    2. Do not need to set the full path for the SaveDirectly.
     
    Try create a folder name "savefile" under the root of your site and set uploader.SaveDirectory="savefiles"
     
    Regards,
     
    Ken 
View as RSS news feed in XML