468,284 Members | 1,603 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,284 developers. It's quick & easy.

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,
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
1 5081
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.

Similar topics

3 posts views Thread by dave | last post: by
3 posts views Thread by Pitcairnia | last post: by
reply views Thread by SEMIH DEMIR | last post: by
3 posts views Thread by gsoguerrilla | last post: by
reply views Thread by Buddy Home | last post: by
7 posts views Thread by xx75vulcan | last post: by
2 posts views Thread by Jason Carlton | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.