Denar All!
I tried to add to my mail download attribute to download a picture to recipient pc/cell Phone, (right Click, inspect code, Edit html), and it accepts simple codes to "play with", but it just ignores 3 line w3schools code with download attribute. Do I Use the wrong pc or wrong doma in and what should it be like?
Just to add, I tried both options: with an internet photo/seems this would not work either, and with the picture from my own pc. For easy peasy code no result at all, makes me already desperated, is anyone willing to help, thanks in advance!
Using Chrome 84
This is most likely a cross-domain or local resource issue. You can verify this by going to DevTools (Menu -> More Tools -> Developer Tools) and checking for errors in the Developer Console.
Try running a server locally, hosting an html page and image, and pointing the image to the URL that this server is also hosting. Here is one way to do it:
Install node
Node.js quick file server (static files over HTTP)
Within that folder set up the following folder structure:
directory
index.html
image.jpg
Create index.html to have the code you want and point at "./image.jpg" with your w3 code like so:
<a href="./image.jpg" download>
<img src="./image.jpg" alt="W3Schools" width="104" height="142">
</a>
Hit your locally running server and try again: http://localhost/index.html
Related
I use SIEGE to test my web server performance. For a more realistic test the best way to go would be to have SIEGE hit the web page (website.com/our-company) and all static assets (.css, .js, .png, .jpg). Everything that you see on the firefox / chrome debbuing tools, except of course from resources loaded from external servers (cdn.facebook, apis.google.com).
I am running several tests so it is a pain to manually collect all asset urls. Is there a tool that I can use to load a web page and export the url for everything that was loaded?
This is firefox debugging. If I could export this to txt or csv, it would be perfect.
I tried CURL on debian CLI but I am no experct. Any tool will help, it does't have to be a plugin of Firefox / Chrome.
Best regards.
In Chrome you can export these data to a HAR file (it's JSON based) in one click. Go to "Network", right click and choose "Save as HAR with content".
Here's a free command line application to convert HAR files to CSV. Hope it helps.
http://www.yamamoto.com.ar/blog/?p=201
EDIT: added the project to GitHub:
https://github.com/spcgh0st/HarTools
On Windows you could use HttpWatch to do this with the free Basic Edition in IE or Firefox:
http://www.httpwatch.com/download/
The CSV export function will export the URLs and other fields to a CSV file.
** Disclaimer: This was posted by Simtec Limited the makers of HttpWatch **
Had the same requirement of exporting HAR files from Chrome DevTools or Firebug to do load testing with siege. Additionally, I wanted to replay POST requests too.
Choose one of these solutions:
hardy # https://github.com/nbibler/hardy - ruby script
har2siege # https://gist.github.com/photopresentr/7974747 - node.js (my script)
Nevermind.
Just fond out the very nive LiveHtttpHeaders extension for firefox.
Best regards.
As you guys know, the HAR file format is a JSON file. So... I looked for a JSON to CSV converter and found this:
https://json-csv.com/
This worked for my HAR file that I got from GTmetrix.com. Enjoy!
You can Export all Http requests from Chrome Developer console by going to the Network tab
select one of the requests in Network Tab
press Right Mouse Button
from PopUp menu select Copy -> Copy all as Har (Curl/Har/etc)
paste into file
i have a simple question, but i couldn't find an easy solution for it, i have a rented ftp, i cant moderate it, and i have a website with links to this ftp, there few archive files that i want them to be downloaded rather than opened directly through browser, my link looks like this:
IMS 200 Client V1.29 (06.02.13)
i solved this problem by using php page that defines the file type, so that browser could understand that it is archive, and then download it, rather than try and open it directly through browser, is there any easier way to achieve it?!
thank u all for the help!
Hope that my case can help you some way.
I have a website that allows user to view news and download files. Oneday, I discover that if I show up the download link to a .rar file directly, eg. http://www.somenet.com/myfile.rar, then it is opened automatically in the browser instead of asking users if they want to save/open it. If I write some code to read and transfer the file to browser, eg. http://www.somenet.com/download?fileid=123, then it is asked to be saved/opened by browser.
After googling a while, I insert a piece of configuration into my Apache Tomcat web.xml (often at CATALINA_HOME/conf/web.xml) as follows:
<mime-mapping>
<extension>rar</extension>
<mime-type>application/x-rar-compressed</mime-type>
</mime-mapping>
then restart the Apapche Tomcat server to take effect.
And now i can click on the direft rar link to download the file.
I also have to restart the IE (FF takes effect right away).
Good luck!
If you can use HTML5 you can try to use:
Download this file
Extracted from: HTML5 link download
I need to upload images into a page in my website.
I usually use WinSCP FTP program because it gives me the option "Copy to Clipboard (Include paths)". I copy images' URL through this option and the images are usually uploading and displaying successfully to the website.
I'm trying to do the same now for a new page but that is not working. Using any option in WinSCP is not helping at all. All I get is a small icon instead of the image. But when I use FileZilla for copying the URL, the images are uploading and displaying successfully. BUT the problem is that the page is requesting the username and the password to display the images.
I've been googling about it and I realise that the problem could be that I need to change the FTP URL to HTTP. I tried to do it this way:
ftp://username#domain.org/domain_restore/pics/anton.jpg
to:
http://username.domain.org/anton.jpg
That is probably totally wrong? I tried some other ways but the problem is I'm only a beginner and I don't have the knowledge how to edit it or how to find out what the problem is.
I followed the instructions of someone from the support of my host and they advised me to do a restore to all my directories in the FTP manager. I did that but I feel like I messed it up because now all the folders and the directories are duplicated. Could that also be the problem?
I'm trying to see what a certain webpage would look like if I replaced a certain image with another. Rather than upload the image, edit the site, etc, each time I tweak it, I'd like to know if there's a way to change the image in the page to my local version while viewing the remote page.
I use Firebug for debugging web development usually, but I'm open to any other tool that might do this.
(It is absolutely impossible to search for this and find anything but questions about dynamic image swapping on a deployed website, so sorry if this is a duplicate.)
Added: I just tried substituting a file:/// URI pointing to the image (copied and pasted from the address bar after manually opening the image), and alas, it did not work — the image fails to change.
It seems to only work with the http[s] protocols (likely for security reasons). You can store your images on service like Dropbox, share the image or folder, then use the public URLs.
Really, you can use any web accessible images, so a local server would work too.
If your image is in a localhost server(not as file mind you) i think you can still put that localhost url in the firebug inspect element and it'll work.
Tried an absolute file path but it doesn't work apparently. So I guess you just have to make do with a localhost server image. That works for me
Quick and Lowtech Answer: Take a screen shot of the page open it in photoshop and drop the local image on a layer above the webpage image.
Hi if you are serving from a webserver, u probably can't point it to a file on ur local drive. Even if its localhost, u can't point to a local file c:/test.jpg for example. Its because the browser sorts of sandbox ur page so that scripts can't access local files.
One way is to upload the new file (new_file.jpg) to the webserver, give the image link an id
<img id="something1" src="test.jpg"/>
Using jQuery in the firebug watch window do
$("#something1").attr("src","new_file.jpg");
You should see the image change. If you are not using jQuery, you can use document.getElementById("something1") and get the element to modify.
Another way is to use http://makiapp.com/
You can overlay an image from you computer onto any website you look at with this. Very cool tool for lining up a comp with your code.
You can:
Drag your test image into Google Drive
Open it in a browser
Go to the actual image path
Use this path as a substitute in Firebug
It's almost as fast as working from a local drive.
I have a .asp application where image files (.PDF) are stored in a directory (fed by a copier/scanner). The created file names are stored in a database table. When a query is launched from the web page a link to the file is created. When clicked the image should be displayed.
This functionality works 100% in Internet Explorer. No such luck in Firefox (and I have some Firefox users). The created hyperlink looks like this file://Server/Scanner/XYZ.pdf
The Firefox helps suggest the reason is this:
Links to local or network pages do not work. As a security precaution, Firefox forbids sites on the Internet to link to files that are stored in your local computing environment. These files may include files on your computer, mapped network drives, and UNC network paths
None of the suggestions for a workaround seem to work (or I am not understanding the steps to create the image display)
Any Suggestions?
This is the default Firefox behavior designed for security .The assumption is probably that most web sites don't know what and where are you local files (including UNC paths).
This could be turned off in firefox:
type "about:config" in the address bar and accept "i'll be careful"
find "security.checkloaduri" in older versions or "security.fileuri.strict_origin_policy" in newer versions of firefox and change the value to "false"
restart firefox
That should do it for you. You have more information here:
http://kb.mozillazine.org/Security.fileuri.strict_origin_policy
http://kb.mozillazine.org/Security.fileuri.origin_policy
Firefox >= 68.0.1
I'm able to preview in Firefox both images and PDF files with local file links using the settings mentioned here: https://bugzilla.mozilla.org/show_bug.cgi?id=1303727
I have used links with local file: test
and added in user.js the mentioned settings (with adjusted sites list):
user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "http://my.intranet");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
Also, when setting Firefox to "Always ask" for PDF files, I was able to "Open with" the PDF in Adobe Acrobat Reader DC, which reported the expected local folder when accessing "File -> Properties".
Firefox >= 1.5.x < 20 (ish)
Search for the Firefox profile folder on your hard drive, e.g. (12345678 stands for eight random digits and letters):
Windows: "C:\Documents and Settings\Username\Application Data\Mozilla\Firefox\Profiles12345678.default\"
Linux: "/home/username/.mozilla/firefox/12345678.default/"
OS X: /Username/Library/Application Support/Firefox/Profiles/12345678.default/
In this folder create a text file with the name user.js. Write the following line into that text file:
user_pref("capability.policy.default.checkloaduri.enabled", "allAccess");
Works on my PC (Firefox 3.0.3 and 19.0 beta) with the following references:
<img src="file://///server/share/image.png" />
<img src="file://\\\server\share\image.png" />
<img src="file://d:\image.png" />
<img src="file:///d:\image.png" />
<img src="file://d:/image.png" />
<img src="file:///d:/image.png" />
<img src="file://localhost/d:/image.png" />
Also, if you are using the NoScript add-on, check the Advanced \ Trusted \ Allow local links option.
Reading at the solution given here, I followed the link Links to local pages do not work and for me, only this worked well (I am using wordpress for a personal FAQ on a local wamp installation):
Go to your "%Your Documents & Settings%\Application Data\Mozilla\Firefox\Profiles\%your profile%\"
edit the file "prefs.js"
add the following lines at the end of the document:
.
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
user_pref("capability.policy.localfilelinks.sites", "http://localhost");
user_pref("capability.policy.maonoscript.javascript.enabled", "allAccess");
You can leave the setting "security.checkloaduri" to its default value, and also the "security.fileuri.strict_origin_policy". Thanks to those 3 lines, you just make an exception for your local server.
Be careful, if you need to go back to that prefs.js file, note that Firefox will have ordered it alphabetically. So the 3 lines you will have added at the end will be somewhere at the beginning ;).
You can load the LocalLink FireFox Add-On, which allows you to right-click on a local link and select 'Open in Foreground Window'. The other 'Open...' menu items are supposed to work, but don't for me.
http://locallink.mozdev.org/
Also, you can use NoScript, like Alex suggests, which enables normal clicking of local links. Thanks Alex.
Marko's solution should work for links that are also on the local filesystem, but I don't think it should allow an http:// page to link to a file:// page.
The issue for people linking from http:// pages is discussed here:
http://kb.mozillazine.org/Links_to_local_pages_do_not_work
along with an explanation of how to circumvent it and expose yourself to risk.
You can instead read the file off the disk and then send it in the Response from your page.
See this link for an example.
Tonnes of thanks I wAs searching this solution since months,
::THis thing worked::
This could be turned off in firefox:
* type "about:config" in the address bar and accept "i'll be careful"
* find "security.checkloaduri" in older versions or "security.fileuri.strict_origin_policy" in newer versions of firefox and change the value to "false"
* restart firefox
::::
shouldn't you really store the pages in your application directory and reference them this way. http://SITENAME/Server/scanner/XYZ.pdf.
We do something similar with files stored all in one directory and just store the file name. we then create the link using the known folder name and append the file name. this works quite well.
Finally firefox is a lot more anal about the directions of the slashes in file names as well. Make sure they are all '/' rather than '\'.
Hope this helps.
beware of incompatibility with gmarks (google toolbar replacer)
both local link and policy manager worked for me; local link is a little smoother, policy manager gives you more control
file://localhost///servername/share/file.txt works for me on FF11
(from a local html file: file:///C:/index.html)