browse button on server - asp-classic

When we put a browse button on an html form, it gives us the option to browse the file on our system only. If I run it on a server, will I be able to browse it on server paths? Basically I want to access the files available on the server. Is it possible?

This is a browser control, so will only allow you to display files that are local to the browser.
If you want to show files on the server, you will need to use the FileSystemObject and output lists to the browser.
Some examples you can look at are:
http://www.micronetsoft.com/ws_webx.asp
http://www.scriptdungeon.com/freeaspscript/freescripts8
http://www.gleamtech.com/products/webexplorer/asp-file-manager
or just search "web file manager"

The files shown are essentially "your files" - so if you are running the site on a server and browsing it from a different machine, you won't be able to see the files on the server.
If you run it on a server and browse the page from that server, you would be able to see the files.
Equally, if you are on the network and map a share on the server on your machine, you should also be able to browse that (using "Map Network Drive", which assigns the share on the server to a drive-letter on your machine).

Related

Download publication files and copy on the client's internal server with ASP.NET core mvc in IIS

There is a site on the client's internal server. I want to add a page to it without publishing it manually on the client's computer, that is, put an update button and download the publication files from the Internet and replace the current publication on the client's internal server.
Like updating the program on the desktop, is this possible or not?
The problem is that the previous publication is used and Windows does not allow deletion to replace the new publication on the previous publication.
This is to reduce the cost of support and labor.
Well, unless you add this code to their web server to do the download, then no, you can't just download file(s) to MY computer from the web, and THEN place them anywhere on my computer, or my computer network.
If you could mess around with my computer from just a browser?
Then while you come to my web site to view some cute cat pictures, then I am going to mess around on YOUR computer, grab a file called my banking, or grab your emails from outlook, or grab a file called my passwords.
In other words, if you could do as you ask, then no one would EVER trust and use the internet again!!!
So, YOU are NOT allowed to mess around with my computer. Hands off - leave my computer alone!!!
When you download a file from a browser, then the USER has to choose where the file will be saved (useally my-downloads).
Now, you can supply a default file location, but it will depend on the browser, and in most cases all you can do is provide a file name, and not a path + folder name.
I mean, what is the path names and folder names if I am using your web site with a iPad or smartphone?
so, a web browser is "sand boxed", and VERY restricted. You can't for example select or set a file name used for up-loading (since as noted, while you view cute pictures on my web site, if my web site can start messing around with files on YOUR computer, then that ability would speed the end of secuirty on the internet.
So, you can certainly "offer" files to download in a web browser, but the user will be in control of the location of that file in near all cases.
Now, you could have a process or program you setup and run on their web server, and it could say every hour check for files on your web site for download, it could then download the file(s), and then place them in the correct folders for that working web site.
But, any old user just hitting the web site? You don't really have control over the file location and being able to place code and content on my computer. (hey, why not come to my site to view cat pictures, and while you doing that, I can install remote desktop or any software that would allow me to control YOUR computer!!!!).
If you come to my web site, do you REALLY want my site to then mess around with the file system on your computer, and place all kinds of content, files, programs and whatever on YOUR computer from you deciding to visit my web site?
I don't think so!!!!
Now, it is possible you want this kind of ability and don't care about security, but the rest of the world and people who use the internet would not agree with granting you that ability!!
now, you could certainly provide them with a desktop program that they install on their workstations.
Once that program is installed, then it could certainly pull content from your web site, and then place such content on their web server running on that same internal network.
So, you have to create + install + have a program you develop for those in that company. Such a program could then download the content from YOUR web site, and then place it on their internal web server into the correct folders.
I suppose you could also have them each time download some content and some program (maybe in a zip file), and again after they download, they would have to run that file/program.
However, the ability to JUST download files and place such files into any location on their computer(s) at that company is simply not possible, and if web browsers had this ability, then no one would ever use and trust the internet again.
And if you going to all that trouble to build some program they could download and run? Why not place that software on their web server that runs every hour and checks for content on your web site, and downloads it automatically anyway?
That way, no users would have to go to the web site to download content, you have some software on the web server that runs every hour to check and download such content.

publish a release version of web site

I have a web site that is created in visual studio 2010 through: File > New > Web site (it is not a Web Project).
I want to publish a release version of my web site but there is no 'Release' mode in VS and there is no possibility to add 'Release' mode through Build > Configuration manager.
How can I publish a release version of my web site ??(I can not convert my web site to a Web Project)
Thank you very mush for your reply.
When you have a website project and your using VS 2010 then somewhere amongst the menu options in the menubar across the top should be an option caled COPY WEBSITE (I think its in the website menu).
So you click WEBSITE > COPY WEBSITE then you will see a new tab appear very similar to an FTP kind of interface, with your LOCAL files on the left and the remmote server hosting on the right.
You could use either FTP or Direct upload but the very last time I could only use it via FTP.
(Of course this may be a personal issue and not affect anyone else).
It goes without saying that if you dontr have a server to upload your website to then it can not be "released" as you called it.
Usually the server or hosting is either on your own server or on a remote (Paid for) server with a service provider.
With reference to the photo below....
Area-1 is where you enter the FTP or HTTP address of the server where you will upload te files.
Loacl-Files This shows your completed website files
Remote-Files This shows the files on the server
Controls These button are used to upload or download files to and from the server
Note that you must have an FTP username and password to use FTP/HTTP transfer,
Some hosts may prefer you to use your admin account username and password.
Hope this helps point you in the right direction

Hyperlink to EXE file

I have created a simple windows .EXE that copies files from one location to another on a target computer.
However, on the website that I'm testing this on, I created a hyperlink:
Here is the download.
However, when I click on the link, it attempts to start CustomApp.exe which is not what I want to happen. I want to prompted to accept the user file, then run it.
Is this something I need to configure on an IIS 7 machine, or in my ASP.NET page?
It's the way your server serves that mime-type. Might have to configure it differently or serve the download using a php/asp.net page and edit the headers.
Some more explanation on how to do this in asp.net from asawyer:
http://msdn.microsoft.com/en-us/library/dhy78ycf(v=vs.71).aspx

opening folder in web site structure in Windows

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.

Uploading files to remote server using ASP.Net(VB) 1.1

I have a file uploading and viewing page in ASP.Net 1.1 using VB. Now the page will be visible in intranet as well internet. Here in my case the intranet and internet servers are different. How can i save the uploaded file in the intranet server and view from there subsequently when the activity is done using the internet server?
I'd suggest that you have both instances of the application (intranet and internet) save their uploaded files to a common location. I'm going to assume, given that you're targeting .net 1.1 that you're probably looking for a solution/directions for IIS 6.0 or below, rather than the 7.x that comes with Vista/Server 2008.
You need to firstly decide where you're going to store the uploaded files, it could be on the Intranet server, the Internet server or a 3rd "filestore" server. Having done that, you can map that location to a commonly named Virtual Directory on each of your two web servers as follows:
Start "Internet Information Services (IIS) Manager" (Start > Control Panel > Administrative Tools)
Expand the "Web Sites" node and find the virtual directory for your application
Right click on the virtual directory and choose "New" > "Virtual Directory..."
In the wizard that appears, give the folder alias as something like SharedUploadFiles
Specify the path in the next step as something like \\192.168.100.1\SharedUploadFilesStore (i.e. wherever you've chosen to store the files
The next step will require security credentials. Set these as a username and password that has read/write access (as appropriate) to the share you've specified in step 5.
In the "Virtual Directory Access Permissions" step set the permissions as appropriate, click Next and then Finish.
Your application will now be able to access files in that share as if they were part of your web servers file system. So, if you had a file located at \\192.168.100.1\SharedUploadFilesStore\sample.txt, you would then be able to access it through both:
http://internetdomain.name/MyWebAppName/SharedUploadFiles/sample.txt
and
http://intranet.mycompany.local/MyWebAppName/SharedUploadFiles/sample.txt
My knowledge of how to solve any issues you encounter whilst configuring this isn't that deep, and you'd probably get a better answer at http://www.serverfault.com/ as whilst your question is a programming one, the answer I've given isn't a programmatic solution (not that it always has to be! =)

Resources