473,508 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

4 New Member
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 5687
renamer
1 New Member
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

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

Similar topics

3
11737
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
5
5434
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
3
3043
by: Pitcairnia | last post by:
The basic purpose of the site is for authenticated users to post event listings, which often include photographs. The user is faced with a page where they can insert all of the information about...
0
4737
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle...
3
6705
by: gsoguerrilla | last post by:
Hi, I have limited knowledge in php and I am having trouble with uploading an image to a remote directory and resizing it if it's larger and renaming it to a unique id, while at the same time I...
0
9768
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
7
2350
by: xx75vulcan | last post by:
Hi, I've got a PHP Upload Form that works great, unless that is, the image your uploading has been modified through a photo editing software. Example: if I upload the image straight from a...
2
2552
by: Jason Carlton | last post by:
I have a simple form that does nothing more than let the visitor choose an image from their hard drive, and then upload it to the server. It doesn't have any other fields than the <input...
8
9831
johngault
by: johngault | last post by:
I've been working with this PHP page for several days now and I'm stumped. The page is supposed to allow the user to upload up to six images for their profile. When the user adds an image it (the...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.