Wednesday, July 28, 2010

System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission,

Upload files to the FTP server via C#.NET code is a simple task when you use System.Net and System.IO namespaces. But when I was trying to do that I get an opportunity to know few more things that I didn’t know before.
NOTE: if you are going to use this FTP upload in commercial hosting server like GoDaddy then please make sure weather you can have the access to do so.
In my experience I could not run my web application in GoDaddy Server. That gave me exception “ System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=……
Even it is working FTP upload in your local machine, when you upload it to the GoDaddy that will not work. It is occurring because of the permission gave by GoDadday to your web application. We talk to the Godaddy and they inform us, they can not allow us to do our operation, because we are using shared hosting server.
When I search an answer for that most of the blogs and forums said they used some other Hosting plan to overcome that.
If you are interesting to know the FTP upload via C# .NET
File Upload in to FTP Server via C#.NET Code
File Download From FTP Server via C#.NET Code






No comments:

Post a Comment