ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 4th, 2003, 08:52 AM
Bloke's Avatar
Bloke Bloke is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 6 Bloke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem with fso movefile (file already exists)

Guys

I'm posting files using a multipart form and ms posting acceptor to a folder on our intranet server. No problem. I then attach them to an email using CDONTS and off they go. Now, I was then deleting them from the folder using fso deletefile and all was fine but I decided that rather than delete them, I would move them to another folder.

I create the subfolder thus:

Code:

'create a folder especially for this requisition...	  
		Dim filesys, demofolder, folcoll
		Set filesys = CreateObject("Scripting.FileSystemObject")
		Set demofolder = filesys.GetFolder("D:\intranet\uploads\")
		Set folcoll = demofolder.SubFolders
		folcoll.Add(rs.Fields("requisitionID").Value)


...fine, but then when I try to move the files:

Code:

'...and move the attachments into it....
			dim objfilesys
			for intx = lbound(arrX) to ubound(arrX)		
				Set objfilesys = CreateObject("Scripting.FileSystemObject") 				


				objfilesys.MoveFile Server.MapPath("../uploads/" & arrX(intx)),  Server.MapPath("../uploads/" & rs.Fields("requisitionID").Value & "/")
			Next


it all goes pear shaped and I get the error:

Microsoft VBScript runtime error '800a003a'

File already exists

Any help would be greatly appreciated as I'm just about fed up of all this web development lark and am contemplating becoming a zoo keeper instead. Or something.

Cheers

Reply With Quote
  #2  
Old September 4th, 2003, 09:25 AM
Bloke's Avatar
Bloke Bloke is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 6 Bloke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Resolved

Changing this:

objfilesys.MoveFile Server.MapPath("../uploads/" & arrX(intx)), Server.MapPath("../uploads/" & rs.Fields("requisitionID").Value & "/")

to this:

objfilesys.MoveFile Server.MapPath("../uploads/" & arrX(intx)), "D:\intranet\uploads\" & rs.Fields("requisitionID").Value & "/"

Did the trick. Hope this is useful to someone else.

Cheers

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Problem with fso movefile (file already exists)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT