Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > File Upload Folder Permissions

Reply
Thread Tools

File Upload Folder Permissions

 
 
Adam
Guest
Posts: n/a
 
      03-23-2010
Hi, I am trying to create a very basic file upload page, where the uploaded
file is placed into a folder on the server (but not in the web path, i.e.
c:\uploads and not c:\inetpub\wwwroot\uploads). On the IIS server it works
correctly, and uploads the files, but anonymous users when they click on the
upload button, it just refreshes the page and doesn't do anything. When it
works on the IIS server, the page displays upload successful, while from
another workstation it just goes back to the upload file comment and removes
the selected file from the fileupload control.

Can anyone please provide any good resources or identify what security I
need to put on the c:\uploads folder and what setting (account) I should set
for the Application pool.

Thanks in advance.
Adam


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-23-2010
On Mar 23, 1:25*am, "Adam" <(E-Mail Removed)> wrote:
> Hi, I am trying to create a very basic file upload page, where the uploaded
> file is placed into a folder on the server (but not in the web path, i.e.
> c:\uploads and not c:\inetpub\wwwroot\uploads). On the IIS server it works
> correctly, and uploads the files, but anonymous users when they click on the
> upload button, it just refreshes the page and doesn't do anything. *When it
> works on the IIS server, the page displays upload successful, while from
> another workstation it just goes back to the upload file comment and removes
> the selected file from the fileupload control.
>
> Can anyone please provide any good resources or identify what security I
> need to put on the c:\uploads folder and what setting (account) I should set
> for the Application pool.
>
> Thanks in advance.
> Adam


It seems that the access to c:\uploads is for local users (like you)
only and you need to add an ASP.NET account. I think you have
try..catch in your code and that's why you can't see the error when
"nothing happens". Disable error catching and you will see the
message.

Hope this helps.
 
Reply With Quote
 
 
 
 
James Parker
Guest
Posts: n/a
 
      03-23-2010
>
>Hi, I am trying to create a very basic file upload page, where the uploaded
>file is placed into a folder on the server (but not in the web path, i.e.
>c:\uploads and not c:\inetpub\wwwroot\uploads). On the IIS server it works
>correctly, and uploads the files, but anonymous users when they click on the
>upload button, it just refreshes the page and doesn't do anything. When it
>works on the IIS server, the page displays upload successful, while from
>another workstation it just goes back to the upload file comment and removes
>the selected file from the fileupload control.
>
>Can anyone please provide any good resources or identify what security I
>need to put on the c:\uploads folder and what setting (account) I should set
>for the Application pool.
>
>Thanks in advance.
>Adam
>
>
>


I think this might help with your issue.

http://learn.iis.net/page.aspx/140/u...nts-in-iis-70/

j1mb0jay

-----------------------------------
Posted @ http://www.dotnethelp.co.uk
 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      03-23-2010
Hi Alexex,

Here is my code, which I have the try - catch statement in. It must be a
permissions thing for it to work on the host machine, but not on any others?

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click

If Not FileUpload1.PostedFile Is Nothing And
FileUpload1.PostedFile.ContentLength > 0 Then

Dim fn As String =
System.IO.Path.GetFileName(FileUpload1.PostedFile. FileName)

Dim SaveLocation As String = "c:\Uploads" & "\" & fn

Try

FileUpload1.PostedFile.SaveAs(SaveLocation)

Response.Write("The file has been uploaded.")

Catch Exc As Exception

Response.Write("Error: " & Exc.Message)

End Try

Else

Response.Write("Please select a file to upload.")

End If

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On Mar 23, 1:25 am, "Adam" <(E-Mail Removed)> wrote:
> Hi, I am trying to create a very basic file upload page, where the
> uploaded
> file is placed into a folder on the server (but not in the web path, i.e.
> c:\uploads and not c:\inetpub\wwwroot\uploads). On the IIS server it works
> correctly, and uploads the files, but anonymous users when they click on
> the
> upload button, it just refreshes the page and doesn't do anything. When it
> works on the IIS server, the page displays upload successful, while from
> another workstation it just goes back to the upload file comment and
> removes
> the selected file from the fileupload control.
>
> Can anyone please provide any good resources or identify what security I
> need to put on the c:\uploads folder and what setting (account) I should
> set
> for the Application pool.
>
> Thanks in advance.
> Adam


It seems that the access to c:\uploads is for local users (like you)
only and you need to add an ASP.NET account. I think you have
try..catch in your code and that's why you can't see the error when
"nothing happens". Disable error catching and you will see the
message.

Hope this helps.


 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      03-23-2010
OMG, i feel so silly. To test the upload from the remote computer I created
a couple of text files without any content. Therefore, with my code
checking content length, it didnt upload it as the content length was 0.

Sorry people!. Thanks for your help though.

"Adam" <(E-Mail Removed)> wrote in message
news:4ba80a99$0$8754$(E-Mail Removed)...
> Hi, I am trying to create a very basic file upload page, where the
> uploaded file is placed into a folder on the server (but not in the web
> path, i.e. c:\uploads and not c:\inetpub\wwwroot\uploads). On the IIS
> server it works correctly, and uploads the files, but anonymous users when
> they click on the upload button, it just refreshes the page and doesn't do
> anything. When it works on the IIS server, the page displays upload
> successful, while from another workstation it just goes back to the upload
> file comment and removes the selected file from the fileupload control.
>
> Can anyone please provide any good resources or identify what security I
> need to put on the c:\uploads folder and what setting (account) I should
> set for the Application pool.
>
> Thanks in advance.
> Adam
>



 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-24-2010
On Mar 24, 12:02*am, "Adam" <(E-Mail Removed)> wrote:
> OMG, i feel so silly. To test the upload from the remote computer I created
> a couple of text files without any content. *Therefore, with my code
> checking content length, it didnt upload it as the content length was 0.
>
> Sorry people!. Thanks for your help though.
>
> "Adam" <(E-Mail Removed)> wrote in message
>
> news:4ba80a99$0$8754$(E-Mail Removed)...
>
>
>
> > Hi, I am trying to create a very basic file upload page, where the
> > uploaded file is placed into a folder on the server (but not in the web
> > path, i.e. c:\uploads and not c:\inetpub\wwwroot\uploads). On the IIS
> > server it works correctly, and uploads the files, but anonymous users when
> > they click on the upload button, it just refreshes the page and doesn't do
> > anything. *When it works on the IIS server, the page displays upload
> > successful, while from another workstation it just goes back to the upload
> > file comment and removes the selected file from the fileupload control.

>
> > Can anyone please provide any good resources or identify what security I
> > need to put on the c:\uploads folder and what setting (account) I should
> > set for the Application pool.

>
> > Thanks in advance.
> > Adam


Glad that it works now for you! You can extend your code and check the
size. Makes sense I think.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload file to server via asp without changing file permissions N. Quisitive ASP General 0 01-17-2006 12:33 AM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
Folder Permissions for File Upload Jay ASP .Net 2 04-05-2005 11:52 AM
ASPX file returning obscur runtime error - after changing permissions to a subweb (.net app) to different permissions than on its parent ? Isabelle ASP .Net 0 08-11-2004 02:04 PM
File upload permissions Mark ASP .Net 2 11-12-2003 05:27 PM



Advertisments