By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,993 Members | 1,883 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,993 IT Pros & Developers. It's quick & easy.

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

P: 4
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,
Expand|Select|Wrap|Line Numbers
  1.  
  2. Set Upload = Server.CreateObject("Persits.Upload.1")
  3. Count = Upload.Save("d:\cmsupload\cimg\")
  4.  
  5. for each File in upload.Files
  6. '
  7. '...sme operation here..
  8.  
  9. set rename = CreateObject("scripting.FileSystemObject")
  10. set f = rename.GetFile(filepath1)
  11. f.Copy "d:\www\cmsupload\cimg\" newname & "." & Ext, false
  12. next 
and then i try to delete the data using this
Expand|Select|Wrap|Line Numbers
  1. Set Upload = Server.CreateObject("Persits.Upload.1")
  2. Count = Upload.Save("d:\cmsupload\cimg\")
  3. for each File in upload.Files
  4. '
  5. '...sme operation here..
  6.  
  7. set rename = CreateObject("scripting.FileSystemObject")
  8. set f = rename.GetFile(filepath1)
  9. f.Copy "d:\www\cmsupload\cimg\" newname & "." & Ext, false
  10.  
  11. Set fso = CreateObject("Scripting.FileSystemObject")
  12. fso.Deletefile ("c:\windows\desktop\" & oldname) 
  13. next
  14.  
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...
Nov 8 '09 #1
Share this Question
Share on Google+
1 Reply


P: 1
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.
Mar 21 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.