Use HTML to move or copy a file - html

I am using a HTML web-page, i don't want to use PHP coding.
I am trying to find some code that will allow me to upload a file and place it in a specified directory. How would i do that.
input type="file", allows me to specify a file but what code allows me to move or copy that file to another location.

It's impossible to oparte on upload file without server-side technology (like php), sorry...

Related

How to load a text file in HTML

Is it possible to load a text file via HTML using somthing like the link tag?
I’m sure I have seen this before but couldn’t find any thing.
I am creating a local app and I want to load a CSV data file and don’t want to have to rely on the user choosing the file with a file input.
If you mean like a file on the user's computer...only if the file's contents are saved in a cookie or using localstorage when the file is saved. But if you mean from a website, you can use XMLHttpRequest.
See https://www.w3schools.com/xml/dom_httprequest.asp

Can i put a .doc or .txt for displaying data in html

I just wonder if i can put a .doc or .txt files in the html instead of placing too much code in showing the data. I think that should be some method but i m not sure about it
You can put a direct URL to a .doc or .txt file on your server without even using HTML if that's most convenient. A browser will typically display .txt files right in the browser itself. A .doc file would likely be offered to store on disk so you can use a program like Word to view it.
If you are talking about embedding data into an existing HTML page there are ways to do so but it would require knowing more about your server. Are you using PHP to respond to requests?
You can use a number of methods to acheive this. Most commonly used are php includes if the server is capable of executing php scripts. Javascript is also commonly used and there are many examples of how to do this. This could also be achieved using SSI (server side include) but this method is not commonly used and requires renaming the file with .shtml extension
Hope this helps.

save html page from the server by URL with no changes - get the exact copy, the clone

Let's say I have a URL http://example.com/path/to/document.html
That's the html document, the file, that has no external css or js.
If I open it in Google Chrome and save it with Ctrl+S locally, the content is changed. The content of that html file starts with <!-- saved from url= which is not I want at all. I need to get the exact html document, even spaces count.
The second option is to copy it with Ctrl+U (View Source), Select All and paste it into new document, save it and rename it. This is better, however spaces, tabs and end of file will be different depending on what operation system I'm using.
I need the exact copy of that html file - byte to byte.
How to make it?
This is a practical question as I need slightly modify that document.
I'm sorry there is no any source code in my question, but this question is about web developing.
Any ideas?
Thank you.
P.S. Of course that document could be generated by php or whatever, the part of the code can be even extracted from the db, but not in my case. I know that's a plain file.
I'd delete the comment after saving from Chrome, use wget in a linux environment, or open the page as an InputStream in Java. Do all three, run a diff, and if two arrived identical assume that's the file on the server.
Why do you need a byte-for-byte copy of the file on the server anyway, and why can't you ftp the file? There is always the chance that the server will serve different html files depending on your user-agent, but there are other tools which may be better than Chrome for getting your copy and many can spoof a user-agent as well.

A web-page that would provide a user to download a certain file from it, but would not disclose the location of that file - is it possible at all?

(I am sorry if my question is not in the right place. (I've been thinking for awhile and came up to the conclusion that this one is the best place for my question)
Is it possible to create such an HTML web-page that would provide a user to download a certain file from it, but would not disclose the location of that file (i.e. the user would not know the URL of the file that he is downloading).
If yes, would you, please, give me some directions as to which HTML code I should use to create such a page.
The HTML page would provide a link to a server side script passing a filename or other unique moniker:
Download Now
The script would read the identifier, derive a full path from it, load the file and write it back with the appropriate headers/mime type causing the browser to prompt the user with the normal download dialog.
The only location data available to the user would be the link to the script - which would - unless you add some security - serve back the file just as if it were a standard url pointing to a file.
(PHP Example)
With pure html, no. But with a serverside script (php, c#, vb, perl, or other) yes. You would stream the file to user. In that case just the serverside script has access to the origin files

Embed HTML + javascript files in Visual Studio Winforms Project

I'm having a hard time trying to integrate some things I thought they would be easy to integrate, but I was wrong.
I have an html file and some javascript files (with no server logic in the html code) and i need to embed them in a Visual Studio winform Project in order to use a WebBrowser control an invoke this html file (which includes the .js files) and I need to have the files inside the client application when I call them.
How can I achieve this?
Thanks in advance!
If everything is in one file, you can embed the file in a ResX container and write
webBrowser.DocumentText = Resources.HtmlSource;
If you have multiple files (eg, images and external .js files), you'll need to copy them to physical files on the end-user's machine to make relative paths work. (or you could put them all into a .mhtml file)