catalyst2 community forums  

Go Back   catalyst2 community forums > Feedback > How-To?

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 30-10-2004, 10:00 PM   #1 (permalink)
Registered User
 
Join Date: Oct 2004
Posts: 31
Creating folders dynamically

Dim MyPath, MyName As String


MyPath = Request.PhysicalApplicationPath & "images\user\" & Format(Now, "dd_MM_yy") ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.

Try
If MyName = "" Then ' The folder is not there & to be created
Dim objDir As New DirectoryInfo(Request.PhysicalApplicationPath & "images\user\" & Format(Now, "dd_MM_yy"))

objDir.Create()

End If

i am getting an error:-

Could not find a part of the path "d:\".


Is there a special way to create folders within the website?

the code above works fine on my own machine
DateWifaDiff is offline   Reply With Quote
Old 31-10-2004, 01:03 AM   #2 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,579
Whats your domain
paulredpath is offline   Reply With Quote
Old 31-10-2004, 01:06 AM   #3 (permalink)
Registered User
 
Join Date: Oct 2004
Posts: 31
datewithadifference.com

lokking to dynamically create folders in wwwroot\images\user
DateWifaDiff is offline   Reply With Quote
Old 01-11-2004, 05:47 PM   #4 (permalink)
Software / Web Developer
 
Join Date: Jul 2004
Location: Nottinghamshire, England
Posts: 158
Send a message via MSN to DaveLegg
I had a similar problem to this at one point turned out to be a permissions error and paul fixed it quickly
__________________
Dave Legg
www.dlpwd.co.uk
DaveLegg is offline   Reply With Quote
Old 01-11-2004, 08:55 PM   #5 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,579
Can you try now please?
paulredpath is offline   Reply With Quote
Old 01-11-2004, 11:29 PM   #6 (permalink)
Registered User
 
Join Date: Oct 2004
Posts: 31
just did

just tried it there no luck it would seem

still same error

changed the paths to be hardcoded

here's the code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

'todo

'Needed on every page
intUserID = CInt(Session("UserID"))
If intUserID = 0 Then
'user has no session
Response.Redirect("../UserLogin/Login.aspx", True)
End If


If Not Me.IsPostBack Then

''FIRST WE NEED TO CHECK THAT THE FOLDER FOR TODAYS PHOTOS HAS BEEN CREATED

Dim MyPath, MyName As String
MyPath = "d:\domains\datewithadifference.com\wwwroot\images \user\" & Format(Now, "dd_MM_yy") ' Set the path.

MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.

Try
If MyName = "" Then ' The folder is not there & to be created
'Folder created
Dim objDir As New DirectoryInfo("d:\domains\datewithadifference.com\ wwwroot\images\user\images\user\" & Format(Now, "dd_MM_yy"))

objDir.Create()

End If
DateWifaDiff is offline   Reply With Quote
Old 01-11-2004, 11:58 PM   #7 (permalink)
Registered User
 
Join Date: Oct 2004
Posts: 31
ouch and ehh not sure if i have actually overwritten folder and lost permissions

doh

sorrrrrrrrrrry




are there any helm add-on to let us manage permission?
DateWifaDiff is offline   Reply With Quote
Old 01-11-2004, 11:59 PM   #8 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,579
Um, open a ticket with how to test the code and ill take a poke.
paulredpath is offline   Reply With Quote
Old 02-11-2004, 01:53 AM   #9 (permalink)
Administrator
 
WhiskyFudge's Avatar
 
Join Date: Oct 2003
Posts: 1,489
Just to check is there meant to be a space before 'user' or is that just the way the forum is displaying the code?

Jas
__________________
Jason Robbins
jason@catalyst2.com
WhiskyFudge is offline   Reply With Quote
Old 02-11-2004, 06:42 AM   #10 (permalink)
Registered User
 
Join Date: Oct 2004
Posts: 31
just the way the forum is displaying them.......i noticed that when i was posting and double checked my code....and the text of the posting

so sadly it wasn't that easy.......:-(
DateWifaDiff is offline   Reply With Quote
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:19 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.