By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

How to create a file folder using ASP.NET 2.0 ?

P: n/a
kai
Hi, All
I am trying to create a file folder for any login user, and create sub
folders for the user on a web page. After the user login again, he can only
sees his own folder on the Web page. I am planning to use VB2005 or C#.

I look the help files and searched on the web, I cannot find the answer. Is
this possble in ASP.NET 2.0?
Thanks

kai
May 25 '07 #1
Share this Question
Share on Google+
10 Replies


P: n/a
On May 25, 9:01 pm, "kai" <kaili...@bellsouth.netwrote:
Hi, All
I am trying to create a file folder for any login user, and create sub
folders for the user on a web page. After the user login again, he can only
sees his own folder on the Web page. I am planning to use VB2005 or C#.
kai,

use DirectoryInfo.Create to create the new folders

For each user/folder create a web.config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
<allow users="usernamehere" />
<deny users="*" />
</authorization>
</system.web>
</configuration>

and locate it in the folder. It helps to protect a folder from
unauthorized access.

Maybe you can explain more detail exactly what do you want to do

May 25 '07 #2

P: n/a
This can surely be done, but I would like to share my experience on files on
the web-server:
I designed an upload function for user files, but after some time the
administrator of the web-server was less happy about the volume of these
files (CD images and other large files). After some pondering I have decided
for another option; storing the user files in blob-fields on an SQL-server.
The administrator said this server had unlimited space, they only add more
HDD's far into TB. Well, in that way it is easy to store userid along with
the file and everything else you want to control access.

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:so*****************@bignews5.bellsouth.net...
Hi, All
I am trying to create a file folder for any login user, and create sub
folders for the user on a web page. After the user login again, he can
only sees his own folder on the Web page. I am planning to use VB2005 or
C#.

I look the help files and searched on the web, I cannot find the answer.
Is this possble in ASP.NET 2.0?
Thanks

kai

May 25 '07 #3

P: n/a
kai
Alexey,
Thank you for your help!
I want to create a web site which manages files for authorized users,
uploading and downloading.

1. A user can create a folder and sub folders for himself on a web page,
then can see his folders in tree views on the web page. The user can then
upload files and download files from his owen folder and subfolders.

2. The next time the user logs in, he will only see his owen folders
displayed on the web page, and it is protected from being accessed by other
users.
Thanks

Kai

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@u30g2000hsc.googlegr oups.com...
On May 25, 9:01 pm, "kai" <kaili...@bellsouth.netwrote:
>Hi, All
I am trying to create a file folder for any login user, and create sub
folders for the user on a web page. After the user login again, he can
only
sees his own folder on the Web page. I am planning to use VB2005 or C#.

kai,

use DirectoryInfo.Create to create the new folders

For each user/folder create a web.config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
<allow users="usernamehere" />
<deny users="*" />
</authorization>
</system.web>
</configuration>

and locate it in the folder. It helps to protect a folder from
unauthorized access.

Maybe you can explain more detail exactly what do you want to do

May 25 '07 #4

P: n/a
kai
Bjorn,
Thank you very much for your help.
After storing files in the SQL Server, can them be organized in the
folders? Can user download the files from SQL Server?
Thanks

Kai

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:gr*********************@telenor.com...
This can surely be done, but I would like to share my experience on files
on the web-server:
I designed an upload function for user files, but after some time the
administrator of the web-server was less happy about the volume of these
files (CD images and other large files). After some pondering I have
decided for another option; storing the user files in blob-fields on an
SQL-server. The administrator said this server had unlimited space, they
only add more HDD's far into TB. Well, in that way it is easy to store
userid along with the file and everything else you want to control access.

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:so*****************@bignews5.bellsouth.net...
>Hi, All
I am trying to create a file folder for any login user, and create sub
folders for the user on a web page. After the user login again, he can
only sees his own folder on the Web page. I am planning to use VB2005 or
C#.

I look the help files and searched on the web, I cannot find the answer.
Is this possble in ASP.NET 2.0?
Thanks

kai


May 25 '07 #5

P: n/a
Of course, the user can download the files from the SQL server. The user
will not know the difference, not knowing exactly where the files have been
stored. After all, the user experience only basic HTML at his end. At the
server end there may be all sorts of magic...

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:VP*****************@bignews5.bellsouth.net...
Bjorn,
Thank you very much for your help.
After storing files in the SQL Server, can them be organized in the
folders? Can user download the files from SQL Server?
Thanks

Kai

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:gr*********************@telenor.com...
>This can surely be done, but I would like to share my experience on files
on the web-server:
I designed an upload function for user files, but after some time the
administrator of the web-server was less happy about the volume of these
files (CD images and other large files). After some pondering I have
decided for another option; storing the user files in blob-fields on an
SQL-server. The administrator said this server had unlimited space, they
only add more HDD's far into TB. Well, in that way it is easy to store
userid along with the file and everything else you want to control
access.

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:so*****************@bignews5.bellsouth.net.. .
>>Hi, All
I am trying to create a file folder for any login user, and create sub
folders for the user on a web page. After the user login again, he can
only sees his own folder on the Web page. I am planning to use VB2005 or
C#.

I look the help files and searched on the web, I cannot find the answer.
Is this possble in ASP.NET 2.0?
Thanks

kai



May 25 '07 #6

P: n/a
On May 25, 11:39 pm, "kai" <kaili...@bellsouth.netwrote:
Alexey,
Thank you for your help!
I want to create a web site which manages files for authorized users,
uploading and downloading.

1. A user can create a folder and sub folders for himself on a web page,
then can see his folders in tree views on the web page. The user can then
upload files and download files from his owen folder and subfolders.

2. The next time the user logs in, he will only see his owen folders
displayed on the web page, and it is protected from being accessed by other
users.
In principle, you don't need to create a folders. As Bjorn said, there
may be all sorts of magic. A "directory tree" can be saved as a
configuration in a database. All files can be either uploaded to
server drive in a global directory (plus names of the files in the
database), or stored directly in a database, as Bjorn has told you.

There are pros and cons of each solution and also a lot of discussions
about that matter

Just found an article that might be interesting to you, take a look
http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=414

May 25 '07 #7

P: n/a
kai
Alexey,
This is a huge help! Thanks
Kai
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@p47g2000hsd.googlegr oups.com...
On May 25, 11:39 pm, "kai" <kaili...@bellsouth.netwrote:
>Alexey,
Thank you for your help!
I want to create a web site which manages files for authorized users,
uploading and downloading.

1. A user can create a folder and sub folders for himself on a web page,
then can see his folders in tree views on the web page. The user can
then
upload files and download files from his owen folder and subfolders.

2. The next time the user logs in, he will only see his owen folders
displayed on the web page, and it is protected from being accessed by
other
users.

In principle, you don't need to create a folders. As Bjorn said, there
may be all sorts of magic. A "directory tree" can be saved as a
configuration in a database. All files can be either uploaded to
server drive in a global directory (plus names of the files in the
database), or stored directly in a database, as Bjorn has told you.

There are pros and cons of each solution and also a lot of discussions
about that matter

Just found an article that might be interesting to you, take a look
http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=414

May 25 '07 #8

P: n/a
kai
Bjorn ,
Thank for sharing your experiences.
After I insert a file for the user, how do you retrive the file for the
user? do you insert username and password into the files_Table?
Thanks

Kai

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Q9*********************@telenor.com...
Of course, the user can download the files from the SQL server. The user
will not know the difference, not knowing exactly where the files have
been stored. After all, the user experience only basic HTML at his end. At
the server end there may be all sorts of magic...

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:VP*****************@bignews5.bellsouth.net...
>Bjorn,
Thank you very much for your help.
After storing files in the SQL Server, can them be organized in the
folders? Can user download the files from SQL Server?
Thanks

Kai

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:gr*********************@telenor.com...
>>This can surely be done, but I would like to share my experience on
files on the web-server:
I designed an upload function for user files, but after some time the
administrator of the web-server was less happy about the volume of these
files (CD images and other large files). After some pondering I have
decided for another option; storing the user files in blob-fields on an
SQL-server. The administrator said this server had unlimited space, they
only add more HDD's far into TB. Well, in that way it is easy to store
userid along with the file and everything else you want to control
access.

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:so*****************@bignews5.bellsouth.net. ..
Hi, All
I am trying to create a file folder for any login user, and create sub
folders for the user on a web page. After the user login again, he can
only sees his own folder on the Web page. I am planning to use VB2005
or C#.

I look the help files and searched on the web, I cannot find the
answer. Is this possble in ASP.NET 2.0?
Thanks

kai



May 26 '07 #9

P: n/a
On May 26, 3:11 pm, "kai" <kaili...@bellsouth.netwrote:
Bjorn ,
Thank for sharing your experiences.
After I insert a file for the user, how do you retrive the file for the
user? do you insert username and password into the files_Table?
just look at the article I've sent you, I think it's explained quite
good

May 26 '07 #10

P: n/a
I think the article Alexey sent you was excellent, it covers it all.
But to answer about my case: Yes I have a user login with username and
password. I keep the username (not the passord - this may be cahanging)
along with customerno and various credibilities in a session var, so each
form can set the appropriate properties for each user. And finally, the
username is stored in a column (LastChangedBy or OwnerID or AddedByID ...)
in various tables. On uploading files, my users have to specify a cathegory
and a description of the file. All this information along with current
datetime and the file itself is stored in a table.

Retrieving is very easy: SELECT * from FileTable WHERE OwnerID=LoginID

Bjørn

"kai" <ka******@bellsouth.netwrote in message
news:gm*****************@bignews8.bellsouth.net...
Bjorn ,
Thank for sharing your experiences.
After I insert a file for the user, how do you retrive the file for the
user? do you insert username and password into the files_Table?
Thanks

Kai

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Q9*********************@telenor.com...
>Of course, the user can download the files from the SQL server. The user
will not know the difference, not knowing exactly where the files have
been stored. After all, the user experience only basic HTML at his end.
At the server end there may be all sorts of magic...

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:VP*****************@bignews5.bellsouth.net.. .
>>Bjorn,
Thank you very much for your help.
After storing files in the SQL Server, can them be organized in the
folders? Can user download the files from SQL Server?
Thanks

Kai

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:gr*********************@telenor.com...
This can surely be done, but I would like to share my experience on
files on the web-server:
I designed an upload function for user files, but after some time the
administrator of the web-server was less happy about the volume of
these files (CD images and other large files). After some pondering I
have decided for another option; storing the user files in blob-fields
on an SQL-server. The administrator said this server had unlimited
space, they only add more HDD's far into TB. Well, in that way it is
easy to store userid along with the file and everything else you want
to control access.

Bjorn

"kai" <ka******@bellsouth.netwrote in message
news:so*****************@bignews5.bellsouth.net ...
Hi, All
I am trying to create a file folder for any login user, and create
sub folders for the user on a web page. After the user login again, he
can only sees his own folder on the Web page. I am planning to use
VB2005 or C#.
>
I look the help files and searched on the web, I cannot find the
answer. Is this possble in ASP.NET 2.0?
>
>
Thanks
>
kai
>




May 27 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.