PDA

View Full Version : Dynamically create a folder


anylanguage
05-20-2004, 10:27 AM
Hi,
I want to dynamically create a folder on the server. Basically what I want to do is to have a folder for every user who registers where she/he can upload documents later.

On my old ISP I used a object called Scripting.FileSystemObject. Do we have something similar here at discountASP.net, if yes, which one?

Thanks for your help
Markus

bruce
05-20-2004, 10:49 AM
There are several ways you can do this (using different components depending on what you preferred)

Yes. FileSystemObject is enabled.


[b]quote:Originally posted by anylanguage

Hi,
I want to dynamically create a folder on the server. Basically what I want to do is to have a folder for every user who registers where she/he can upload documents later.

On my old ISP I used a object called Scripting.FileSystemObject. Do we have something similar here at discountASP.net, if yes, which one?

Thanks for your help
Markus
</blockquote id="quote"></font id="quote">

ozecommerce
05-09-2007, 06:24 AM
But is CreateFolder enabled? The method of FSO to create a dynamic folder? If so, do we need to set permissions?

vvsharma
05-09-2007, 06:28 AM
You can use the following to create directories dynamically:

//Namespace -System.IO

Directory.CreateDirectory</font>(Server.MapPath('.')+'/Directory_Name');

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

bruce
05-09-2007, 08:18 AM
Yes. CreateFolder is just a method of FSO, since FSO is enabled, you should be able to use all methods.

You should not need to change permission unless you have tightened it yourself in the permission manager.

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

ozecommerce
05-09-2007, 08:35 AM
bruce [DASP] said...
Yes. CreateFolder is just a method of FSO, since FSO is enabled, you should be able to use all methods.I'm no expert, but I have a site with another Hosting company and they disabled the Folder methods, but NOT the File methods of the FSO Object. That's why I came looking (and purchased) on DASP. As an FYI, I had attempted to install a photogallery which uses the CreateFolder (and Delete) of FSO that was not working elsewhere, or here initially. The software had set it's own User Id and password in the login. I had to add that User Id as a User (via the Permissions Manager) and give that id write permissions to the Photogallery folder which 'seemed' to fix the problem. The only reason I say seemed is it failed on certain functionality of the software still, but that may have been related to database corruption when it wasn't working previously? Once I re-installed the db, it all started working?

bruce
05-09-2007, 10:16 AM
This is interesting!! i didn't think you can disable a method but I'll take your word for it.

Glad you got this to work!

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

ozecommerce
05-09-2007, 10:49 AM
OK, ignore my last comment about disabling 'some' methods of the FSO component. I guess that's called "help line" mis-information? They have an "alternative" way of uploading files, which is what they meant by allowing you to "create files", not "createfile" (FSO). So, they don't allow any of the FSO methods by default. Not exactly how it came out from the help line technician. Sorry for any confusion.