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

Reply
 
Thread Tools Rate Thread Display Modes
Old 30-10-2004, 10:00 PM   #1
DateWifaDiff
Registered User
 
Join Date: Oct 2004
Posts: 33
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
paulredpath
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,637
Whats your domain
__________________
Paul Redpath
paul@catalyst2.com

Follow us on Twitter at: http://twitter.com/catalyst2
Like us on Facebook: http://www.facebook.com/catalyst2

Go on, review Us at OC Host Review!
paulredpath is offline   Reply With Quote
Old 31-10-2004, 01:06 AM   #3
DateWifaDiff
Registered User
 
Join Date: Oct 2004
Posts: 33
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
DaveLegg
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
paulredpath
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,637
Can you try now please?
__________________
Paul Redpath
paul@catalyst2.com

Follow us on Twitter at: http://twitter.com/catalyst2
Like us on Facebook: http://www.facebook.com/catalyst2

Go on, review Us at OC Host Review!
paulredpath is offline   Reply With Quote
Old 01-11-2004, 11:29 PM   #6
DateWifaDiff
Registered User
 
Join Date: Oct 2004
Posts: 33
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
DateWifaDiff
Registered User
 
Join Date: Oct 2004
Posts: 33
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
paulredpath
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,637
Um, open a ticket with how to test the code and ill take a poke.
__________________
Paul Redpath
paul@catalyst2.com

Follow us on Twitter at: http://twitter.com/catalyst2
Like us on Facebook: http://www.facebook.com/catalyst2

Go on, review Us at OC Host Review!
paulredpath is offline   Reply With Quote
Old 02-11-2004, 01:53 AM   #9
WhiskyFudge
Administrator
 
WhiskyFudge's Avatar
 
Join Date: Oct 2003
Posts: 1,501
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
DateWifaDiff
Registered User
 
Join Date: Oct 2004
Posts: 33
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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Pingbacks are Off
Refbacks are Off

Forum Jump