Configuration :: Create File Outside From Root (virutal) Folder On Server?
May 17, 2010I have written code to upload file through httpweb request.No I want to save this file outside the root folder on server.
View 2 RepliesI have written code to upload file through httpweb request.No I want to save this file outside the root folder on server.
View 2 RepliesWhen we select pull down menu Build -> Publish .... website. The cs extension file dropped into bin folder instead of root folder.
View 2 RepliesSo, I have a webForm that has an ImageButton. This ImageButton has to open a file (said file is uploaded by the user in another web form. The file is saved to \serverNamefiles; it can be a doc file, pdf file, excel file).
So this ImageButton should open said file as you normally would. It works on debug, however when I publish my site, and run it from my localhost, it doesn't open the file. When I click the ImageButton it just does the postback and nothing happens.
The code for the ImageButton is just:
Process.Start(fileName);
fileName has the full path of the file I want to open, in this case it has: \serverNamefilesmyFile.pdf
I want to write a sitemap.xml to the root folder of my website automatically every month. Ofcourse I havent given the IIS_IUSRS group full permissions on the root folder of my website or on sitemap.xml
But what permissions should I give to which usergroup on which folder/file in order to have my ASP.NET application update the sitemap.xml from within the asp.net web application?
I am having trouble doing it. Getting error becuase two different web.config file in each one of them. In my ROOT folder I have a web application written in ASP.NET framework 2.0 . Now, I have all kind of sub-folders for other applications in .NET 2.0 or 3.5 . This is the first time I have sub-folder with application in .NET 4.0. There is a conflict between two web configuration files. How can I solve it? I cannot change the Root or other sub-folder, only If there isn't any other way to solve this.
View 2 RepliesIn Visual Studio I added a text file Example.txt to the root folder of my web site (where Default.aspx exists).
Later in C# code I reference this file :
string text = File.ReadAllText("~/Example.txt"); // also tried without the ~/
During runtime, both debug and non-debug, I get an error at this line of code:
C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0Example.txt'.
So, how should I reference this file?
I have an excel file created at this link:
<a href=""Exports/" & fileName & """></a>
how to open it in a button click, using asp.net / vb.net as codebehind.
I am working on asp.net 3.5 in C#. In my application I have to Create folder and upload file in that folder, which works fine on my machine. I want help for create folder and upload file in that folder on other machine which is connected in LAN. code for create folder and Upload file on my machine
string FileName = FileUpload1.FileName;
i need to create xml document from SQL with the root elements & the sub elements
how do i do it uisng vs2005
i do have a xsd. the generated xml shld be validated with the given xsd
I am using asp.net 3.5. And i am serializing an object in server, I rent a hosting and i want to modify something in a dinamic way with XML,
This is my code :
Stream writer = new FileStream(Environment.CurrentDirectory + @"public_html" + nombrearchivo.Text, FileMode.Create);
serializer.Serialize(writer, p);
this is my error massage:
Exception Details:
System.UnauthorizedAccessException:
Access to the path
'C:WindowsSysWOW64inetsrvdasd.xml'
is denied.
I am having problems getting the security.aspx to load up on my primary development computer which is using Windows 7 Ultimate and Windows IE 8. Clicking on the ASP.NET Configuration icon from the IDE in the Solution Explorer within Visual Web Developer 2008 Express Edition loads up default.aspx with no problem. But when I click on the "Security" hyperlink to access "security.aspx" I get a message along the lines of "The configured SQL data source provider is not properly configured". It goes on to state a list of potential reasons for this problem. One that includes not having the proper credentials or permissions. Im almost 100% sure it has something to do with permissions because I can't even get to the "security.aspx" page from opening a new empty project. I have recently installed Visual Web Developer 2008 Express Edition on my laptop which is running Vista with all latest updates and this issue does "not" exists. I can click the "ASP.NET" icon, load up "default.aspx" and click "Security" and it loads the page with absolutely no issues.
I have discovered a weird workaround but I don't like having to do this. If I add the following lines to my "web.config" file from any given project I can get to the "security.aspx" page without getting any SQL messages about improper configuration or permissions.
<<remove "LocalSqlServer">
<add
name="LocalSqlServer"
connectionString="data
source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient"/>
Basically, what I have to do to get to the security page to load without error is add a remove statement and then I just cut'n'paste almost the exact same connectionString from machine.config in the Microsoft.netFrameWorkV2.0.5027config directory. This does away with the "Improperly configured SQL datasource message" and gets me a new error message along the lines of "Could not create a SQL instance". My memory is fuzzy on exact error messages since Im not at development computer right now. However, when I change the User Instance attribute from true to false, then I have success at last.
I have this linein my code behind, but ShipTo.aspx in not is same folder its in the root that would be ../ShipTo.aspx , I am not sure how I can fit ../ShipTo.aspx instead of ShipTo.aspx in the line.
addressBook.Attributes.Add("onChange","ShowPopUp("
ShipTo.aspx?LineKey={0}&LabelKey=" + this.value + "&sourcePage=Cart.aspx", "400", "500", true);"
I am trying to deploy my C# based ASP.Net 3.5 webapp
The hosting service provider said "Access 2003 (.mdb) file has to be put in 'access_db' folder in root folder"
I am currently using
OleDbConnection myConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("~/access_db/filename.mdb"));
The folder structure is like
ParentFolder/access_db/filename.mdb
ParentFolder/ProjectFolder/<Project files> (App_Data, bin, *.aspx, web.config)
1) I am using a GridView on another page that doesn't allow to connect to a database outside the project folder. What should I do?
2) How do I modify the programmatic connection string ( shown above) ?
I'm using a .resx file which have some name and values.. I wanna read the values programatically.. the recource file is inApp_GlobalResources folder of the project..
I'm using Visual Studio 2008.. and C# as Code behind.
I need to Copy the Uploaded file to D Drive in Asp.net 1.1 using C#
View 1 RepliesI am trying to select all the files from a folder in my website and store them in a collection. The problem is that when I run the website it is not selecting the folder in my website:
This is the basic structure: [Root Folder] --> [FilesFolder]
Here is the code I am using:
DirectoryInfo dir = new DirectoryInfo("FilesFolder");
But it is showing this at runtime as the location of the folder:
C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0FileUploads
Is there a way to select the folder relative to the root of the website?
I am using C# with ASP.NET 3.5
i want to keep the database in the root folder of my application.what would be the connection string ?
View 1 RepliesI have javascripts folder under root folder , its all workig fine till now. Suddenly it started giving me the following error for all the javascripts under scripts folder.I the only change i made today is , deployed some files under website root directory which are asp files. I didn't deploy any files to scripts folder at all.
I saw in firebug net panel and i got the same error there.
The page cannot be displayedYou have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed. try the following: Contact the Web site administrator if you believe this directory should allow execute access.
HTTP Error 403.1 - Forbidden: Execute access is denied.Internet Information Services (IIS)
Technical Information (for support personnel)
How to attach all root folder to Dropdownlist in web Application using C#...
View 1 Repliesi have a few doubts about the below file directory concept, for creating file directory. How can i create folder using file directory the code i have done but am getting the error, I want to create folder like below,
mchpopagesTermsclientname
--->clientname folder which is come from my class file
code is :
protected void btnUpload_Click1(object sender, EventArgs e) {
try {
//if (ASBsupplier.Text == "")
//{
// lblMessage.Text = "Select Supplier";
// return;
[code]....
How can I setup the code in default.aspx to automatically direct the user to the default page for the application. If the user types the server name as in http://MyIntranet, I want them to be redirected to [URL]
[Code]....
IIS threw back the error that the operation requires IIS integrated pipline mode, which obviously isn't available because we're running IIS6.
[Code]....
View 5 RepliesEDITED To make issue more clear. I have also discovered this same issue with validatorcallout extensions used in a usercontrol in a root page and a subfolderpage
I have a strange issue I cannot figure out. I have a usercontrol that is used to display news story details. One of the requirements is to be able to email the story to someone. In this control I have included a modal popup to do contain the email form. What is really strange is that if the control is used in a page in a subfolder themodalpopup works as designed but when the control is in a page in the root folder while the usercontrol still works, themodalpopup control stops working.
Controls/StoryDetails.ascx
[Code]....
This control gets placed within a masterpage via a base MasterPageClass when there is a storyid in the querystring object
[Code]....
When the master page resides at the root level the popup doesn't work but in anyother folder it does work.
I had a look at Displaying images that are stored outside the Website Root Folder
View 1 RepliesProgrammatically i am planning to move multiple files, Is it possible to move multiple files to a folder "d:MyTempFileFolder"
and create a compressed zip file of all files which are in this folder: "d:MyTempFileFolder" and then will try to download it.
using asp.net / sql server on windows 2003 server