473,806 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File upload problem

Hi,

I want to upload *.jpg files to server using FileUpload control. Hosting is
shared and administrator informed me that I have to use medium trust level
to upload files. How to achieve that?

I get error:

: The application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission please
contact your system administrator or change the application's trust level in
the configuration file.
Line 10: FileUpload1.Sav eAs("\images\re s\" & FileUpload1.Fil eName)I
am new to ASP.NET ?

Thanks a lot!
Domac
Apr 11 '08 #1
3 2544
You have to grant write permissions on the images folder to the ASPNET or
whatever account your app is running under.
Peter
"Domac" <do***@domac.dd wrote in message
news:ew******** ******@TK2MSFTN GP04.phx.gbl...
Hi,

I want to upload *.jpg files to server using FileUpload control. Hosting
is shared and administrator informed me that I have to use medium trust
level to upload files. How to achieve that?

I get error:

: The application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission please
contact your system administrator or change the application's trust level
in the configuration file.
Line 10: FileUpload1.Sav eAs("\images\re s\" &
FileUpload1.Fil eName)I am new to ASP.NET ?

Thanks a lot!
Domac
Apr 11 '08 #2
You have to grant write permissions on the images folder to the ASPNET or
whatever account your app is running under.
Peter
"Domac" <do***@domac.dd wrote in message
news:ew******** ******@TK2MSFTN GP04.phx.gbl...
Hi,

I want to upload *.jpg files to server using FileUpload control. Hosting
is shared and administrator informed me that I have to use medium trust
level to upload files. How to achieve that?

I get error:

: The application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission please
contact your system administrator or change the application's trust level
in the configuration file.
Line 10: FileUpload1.Sav eAs("\images\re s\" &
FileUpload1.Fil eName)I am new to ASP.NET ?

Thanks a lot!
Domac
Jun 27 '08 #3
On Apr 11, 10:13*am, "Domac" <do...@domac.dd wrote:
Hi,

I want to upload *.jpg files to server using FileUpload control. Hosting is
shared and administrator informed me that I have to use medium trust level
to upload files. How to achieve that?

I get error:

: The application attempted to perform an operation not allowed by the
security policy. *To grant this application the required permission please
contact your system administrator or change the application's trust level in
the configuration file.

Line 10: * * * * FileUpload1.Sav eAs("\images\re s\" & FileUpload1.Fil eName)I
am new to ASP.NET ?

Thanks a lot!
Domac
MSDN: "For a call to the SaveAs to work, the ASP.NET application must
have write access to the directory on the server. There are two ways
that the application can get write access. You can explicitly grant
write access to the account under which the application is running, in
the directory in which the uploaded files will be saved.
Alternatively, you can increase the level of trust that is granted to
the ASP.NET application."

http://msdn2.microsoft.com/en-us/lib...as(VS.80).aspx
http://msdn2.microsoft.com/en-us/lib...4y(VS.80).aspx

Hope this helps
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3933
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
3
2852
by: Bijoy Naick | last post by:
I've written a simple file upload user control in VB .NET. It comprises of an InputFile HTML Server Control, an Upload button and a message label. User clicks on the Browse button of the InputFile control, selects a file, then clicks on the Upload button. The file is saved to a folder on the server and the message label displays the appropriate msg. The user control also has a SetFilePath method.. This is used by the page which includes...
6
4141
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page comes back with all the data intact, except for the upload object. The text box for "MyFile" (my example) is always cleared. Why is that and is there a way to stop that from happening? Thanks,
18
4363
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't get it to upload a file to the FTP server. I just get a "Cannot connect to remote server" error after this TRY: s = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
4
4489
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use one of my webform pages which includes a button that pops up a window where you can upload files, if you upload files in this popup window, it seems to somehow clear out all of the session variables and the users get logged out. However, if...
5
1601
by: William LaMartin | last post by:
I have a VB ASP.Net application where the user can upload a file using the FileUpload server control. I also want a thumbnail to be created for this file. Unfortunately I can see no means to determine when the file upload is complete so that I can use the MakeThumbnail function as part of the code. My current workaround is to supply an addition button the users can click on when they think the upload is done that will find the uploaded...
4
2420
by: riteshjain82 | last post by:
Hi, Please go through this: I am having a file (default.asp) on which i am taking many details from a user before mailing it to someone. I have also provided the user with a facility of uploading files on a server. I am uploading files from a page upload.asp which has a link on default.asp. Now my problem is that, how can i send the file name that is uploaded, in a mail along with other details that the user enters on default.asp?? In...
6
3043
by: Vic Spainhower | last post by:
Hello, I am trying to do a FTP file upload which works fine on my localhost but on my ISP server it fails. I can't seem to find where I can go to find the specific cause of the failure. In both cases the file is being transmitted to the same FTP server and using the same PHP script so it shouldn't be a file size or login credentials problem. Could someone please help me out and give me some ideas what is wrong. I would really...
7
3193
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file" name="file_1" size=46 /><input type=submit /> so, after adding a few files, the input fields look like this:
1
2726
by: pbd22 | last post by:
hi. i have been posting this here and elsewhere a lot and can't seem to get resolution on this problem. i have been trying to upload files using a hidden iframe to a asp.net/vb.net form. the problem is that the server code can't read the httpfilecollection. the count is always zero. my upload form's form tag looks like this:
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.