asp classic vb6: upload multipe image. Rename files and delete.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • achotto
    New Member
    • Aug 2009
    • 4

    asp classic vb6: upload multipe image. Rename files and delete.

    hi, i try to upload a multiple image files. after that i will rename the files name.
    the problem is when i upload a 2 or more same files name exp-goal.jpg, it will return "files already exist". ok this is my codes,
    Code:
    Set Upload = Server.CreateObject("Persits.Upload.1")
    Count = Upload.Save("d:\cmsupload\cimg\")
    
    for each File in upload.Files
    '
    '...sme operation here..
    
    set rename = CreateObject("scripting.FileSystemObject")
    set f = rename.GetFile(filepath1)
    f.Copy "d:\www\cmsupload\cimg\" newname & "." & Ext, false
    next
    and then i try to delete the data using this
    Code:
    Set Upload = Server.CreateObject("Persits.Upload.1")
    Count = Upload.Save("d:\cmsupload\cimg\")
    for each File in upload.Files
    '
    '...sme operation here..
    
    set rename = CreateObject("scripting.FileSystemObject")
    set f = rename.GetFile(filepath1)
    f.Copy "d:\www\cmsupload\cimg\" newname & "." & Ext, false
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.Deletefile ("c:\windows\desktop\" & oldname) 
    next
    but it return error, file no found.
    it work perfectly if i insert the diffrent files name but something i dont really understood in here isn't the upload.Files will functioning like an array? array(0) then if next, array(1) and continue...
    Last edited by jhardman; Nov 9 '09, 03:46 PM. Reason: add code tags
  • renamer
    New Member
    • Mar 2010
    • 1

    #2
    Looking for the easy way to batch Rename Files and folders by the thousands? RenameMaestro is probably the easiest batch file renamer you'll find to instantly rename multiple files:
    This swift and simple to use File Renamer lets you add increasing or decreasing numbers, letters and dates. You can swiftly add and remove text, include the created date in the file name, press rename and watch it rename files in a split second.

    Comment

    Working...