I have a small file that I want to place on an asp.net server which can then be downloaded. The file is to be placed on an ASP.NET server.
My confusion is about where I can put a file in an ASP.net project to have it accessible by URL? I haven't written anything for ASP in several years and don't remember that much about it. I'd like to be able to ftp a new file to the server from time to time as required.
Can anyone point me in the right direction on this? Thanks..
When you say "ASP.Net", it sounds like what you really mean is "IIS on Windows". You don't even need to install ASP.Net on the server to make the file available. All you have to is install IIS and put the file somewhere in the wwwroot folder or another hand-configured location.
Related
I have a basic question so apologies in advanced but I have been googling for hours and not been able to find the answer. I made an ASP.NET Core Razor Pages app and deployed it to a folder (which is in a network, it's basically our staging environment) and now need to know how to access the index page in the URL. I followed this doc on how to publish the app into a folder: https://learn.microsoft.com/en-us/dotnet/core/deploying/deploy-with-vs?tabs=vs156 (I chose the Self-contained deployment without third-party dependencies option) but now how do I access the index file?
For example if this is the URL: https://testing.com/FolderName
And the app is in the 'FolderName' folder what do I need to follow up next in the URL to open the app? Inside the FolderName folder there is wwwroot folder, appsettings.Development, appsettings, the .exe, a .pdb, and a web.config. So how do I access the app in the web? I also tried copy/pasting the files and navigating to index.cshtml but didn't work either.
Any help would be greatly appreciated. Thanks guys.
Razor Pages are not routed based on the file system (like PHP).
You start the Web server (by opening the exe) and navigate to the URL where the Web server tells you it's serving the app (in the terminal you should see a line that says "Listening on https://your_url:port...").
The index should be the first thing you see when you navigate there.
Im using ssh&xming to upload files to my server. I have no access to the settings of the server, so I dont know if IIS is installed.
Im trying to run a asp.net project on my server, but all I get when Im trying to run the webpage is the source code.
how can I display the page? is there any way to install IIS on SSH without any access to the settings of the server? or to upload some other file to the server that can help run aspx files?
how to display asp pages on server without iis
thanx
No you cannot install IIS (or anything else) if you don't have administrator access to the server.
And no you cannot run aspx files without IIS. Maybe, just maybe there are ways to do that if you really wanted to, but I'm not aware of that. And why should you? That's like trying to make a boat fly while there are already airplanes available.
I have a question about hiding or encoding the source code on a server which runs IIS.
At the moment the source code is available and visible for all users who are logged into the server where the IIS Server is running.
Is there a way to hide the Code (encode) with Visual Studio or any other software?
I think the aspx (or *.html) web site code can not be encoded but (for example) the *.vb code sites should be able to encode.
You can simply Publish the website
Build Menu => Publish Web Site
So the code behind files (*.aspx.cs) will get converted to dll(Bin/*.dll) file.
Refer this: Walkthrough: Publishing a Web Site
When you are ready to put your project live make sure that you.
Publish it.
When you publish it that you tell it to compile your code into a single library or code behind files.
If you want to protect your html as well then you should not select to make the site updateable.
These steps will protect your code but as for your web.config file you will need to look at some other articles on securing its info.
If you can, I would recommend ensuring that only the authorized people have access to the server and/or the code base running on the server. If that is the case then you should be ok.
Go to Build menu---> Click on Publish the Website.
then a folder get created on the base folder. and the encoded files are available there. That can be upload to the FTP account, then third party can't see the source code with the browser.
I am trying to set up a hyperlink to open a Windows Explorer, so that it can display a folder on the web server that is within the web site.
So in IIS, we have inetpub/MyWebSite/subFolder/Data/
I would like to allow for a web page hyper link to open the folder /Data
I can set up a user account on the web server and only provide access to this folder. I can use ASP Membeship to restrict access here, and/or assign the Network Service acccount access.
I don't really care who can see this folder as anything that gets placed in here will only be temporary, and nothing is "Mission Critical" just a file that the web site will read and write to and then it gets deleted.
Any and all ideas and suggestions will be tested.
Thanks for any help.
Build a representation of the folder's contents (using a DirectoryReader and CSS) and display that. Don't actually try to display the physical folder.
this sounds like FTP, and if it's on an intranet, why not create a share? much less work.
I have a webservice that exists in an asp.net website. When I publish the site to a test server I have to go into the bin folder and into the .svc file for the service and manually change the URL to correctly reflect the test server URL. Is there a better way to handle something like this?
You could always run a build tool to automatically do this for you.