Difference between file:/// and file://///%3F/ - javascript

I made a webscraper using python and a auto .html writter to represent the downloaded data, and the files are saved in folders based on the page title.
In the .html, an anchor tag was (C92) [Kuragamo (Tukinowagamo)] Tonari no Chinatsu-chan R - Next Door's Chinatsu-chan R [English] [Team Koinaka]
As you see it's a relative link in my Windows system.
Whenever i click to the anchor point, it opens this link
file:///E:/Random%20Codes/C/Python/Test/Web%20ripper%202/Web-leach/Download_Projects/RA%20RA%201.1/(C92)%20[Kuragamo%20(Tukinowagamo)]%20Tonari%20no%20Chinatsu-chan%20R%20-%20Next%20Door's%20Chinatsu-chan%20R%20[English]%20[Team%20Koinaka]/(C92)%20[Kuragamo%20(Tukinowagamo)]%20Tonari%20no%20Chinatsu-chan%20R%20-%20Next%20Door's%20Chinatsu-chan%20R%20[English]%20[Team%20Koinaka].html
and shows that the link is unavailable and asks me to check the link.
However I tried to open it through file manager and it opens the file with this link:
file://///%3F/E:/Random%20Codes/C/Python/Test/Web%20ripper%202/Web-leach/Download_Projects/RA%20RA%201/(C94)%20[Kuragamo%20(Tukinowagamo)]%20Tonari%20no%20Chinatsu-chan%20R%2003%20-%20Next%20Door's%20Chinatsu-chan%20R%2003%20[English]%20[Team%20Koinaka]/(C94)%20[Kuragamo%20(Tukinowagamo)]%20Tonari%20no%20Chinatsu-chan%20R%2003%20-%20Next%20Door's%20Chinatsu-chan%20R%2003%20[English]%20[Team%20Koinaka].html
The only difference I could find was file:/// and file://///%3F/ at the beginning and I replaced file:/// with file://///%3F/E in the html file and it worked absolutely fine.
Tested on other files and found only some works with file:/// and all works with file://///%3F/
So when should I tell the anchor to open starting with file://///%3F/E or file:///
sorry the links are too big but i think they are important.

Related

is there any idea to download a pdf from sublinks?

i have a website http://studies.hum.da.gb contains many links like this one:
http://studies.hum.da.gb/mod/resource/view.php?id=7562
when i click one of them it open a pdf document like this one
http://studies.hum.da.gb/pluginfile.php/97808/mod_resource/content/1/anatomyLv.pdf
my question is How do i get all the documents without click every link ?
i tried to:
1-navigate http://studies.hum.da.gb/pluginfile.php/97808/mod_resource/content/1/
no susccess
2-i tried web grabber like httrack but not worked
i am using linux as my OS
maybe i can simulate a mouse click on every link and download the resulting pdf without open it on another tab but i have no javascript experience

Open Select File Dialog on a predifined directory

For my project I need the users to be able to select a file from his PC.
Every user has his own path, and I must open the Select File Dialog ( Input type="file" ) on his path by default, so they can dirrectly pick the file without the need to search for the directory. By default when you open the Select File Dialog, it opens on a default location , example, Desktop / Downloads, and the next time you open it, on the last time you selected an item.
My question is, how can I archive this?
How can i specify the default Path?
It dosnt matter if you open the page from a Mac or Phone or whatever.
It dosnt need to be a html Input, it could be in JS, JQuery ...
I read that by security reasons you can't, and it seems legit but i found like for mozilla you can https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tutorial/Open_and_Save_Dialogs
Dunno if this could be archived on other navigators as Chrome or IE.
If anyone has archived it, could you pass me some URLs or code plz?
Thx in advance
No, you cannot do that. it's against the rules. Your "firefox" link refers to extensions, not pages. It would be a security issue to allow scripts to get any information about your computer's directory structure. If the open had an error callback for example, a script could guess user names in the background and try to open a folder for each of them until it no longer failed.

Saved website withe javascript image link broken

I want to save this page for offline use, but after saving it completely in chrome, the image links are broken. What is the problem and a solution for something like this?
http://www.xlr8.at/8x8hexbin/
Chrome actually created a new folder for all the images, but the original website has its images in the same root folder as the webpage, thus the links are broken. So saving a webpage like that is not a good idea, but since this website has only 2 images, I am able to fix the link easily by moving those image back to the root folder, and fix the links on the html file.

Open a Word File from Javascript Similar to Clicking a Hyperlink

I have a hyperlink in my web page that opens a Word document however before the document is open I need to perform some other tasks. I substituted the hyperlink for a button and this successfully runs my code but how can I then open the Word document in a browser agnostic fashion, i.e. similar to the anchor element;
Produce Report
I have tried several searches for this problem but most of the responses suggest using something like "window.location" top open the file but I don't want to load the file in the browser.
Any suggestions would be greatly appreciated.

Get local file paths to place in img tags in html [duplicate]

I have an editable div and a user can paste a picture copied from Office Word. After doing so an image-tag can be seen in the source code, but the path does not work anymore. If I just enter the source link into to the browser, I can see the image. How to modify the link to make it work?
HTML
<img src="file:///C:/Users/myname/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg" v:shapes="Grafik_x0020_1">
You can't open local file in site without user interaction. Browser won't allow that, because it would be great security flaw.

Categories