Downloading files from URL - file

I have a question related to a security on website. Lets say that a visitor is currently on a http://www.example.com/. And visitor navigates to gallery page. There he can find unique images that are displayed to him according to his log in details he provided earlier. A simple inspect on a picture shows him the URL to that picture: www.example.com/images/image_589326.png.
My question is: Is there a way for a user to somehow download all the files from
www.example.com/images/ folder, or somehow find the names of all images that are in that folder and simply view them with absolute URL.

Yes, that is possible. There are two main ways that this can be achieved: scraping & enumeration.
Through scraping someone would make a script that would look at the gallery page and make a list of all of the images, and then download them all.
Enumeration would just request http://www.example.com/images/image_000001.png through http://www.example.com/images/image_999999.png and download of the images that are present.
If the site is not proprely set up you may also be able to get a directory listing from http://www.example.com/images to see all of the files in the images/ directory.

Related

How can I download a NextJS page as a static HTML file?

so I have this website made with Next and on a page there are some graphs (the graphs content changes as it fetches an API) and info.
I want to add a button to the page and when pressed it download the page as a HTML file and includes all the JS and CSS in the HTML file instead of separately, does anyone have any idea as to how to approach this problem. (The graphs content should be the same content as it was on the time of downloading)
(The reason why I want to do this is because I want to distribute these files to others and I want to allow them to read it w/o an internet connection)
You can't really download a React 'page' because there are no pages in React to download.
Next further complicates this because it server-side renders everything and rehydrates client-side. If you inspect one of your pages, you'll see the JSON blocks Next uses for data. Look for the __NEXT_DATA__ script (usually in the footer of your page).
I think the two strategies you could use:
Screen-capture of the graphs during your build sequence and push them over to an AWS S3 bucket or similar (cumbersome)
When I ran into a requirement like this, I just made the data for the graph available as a JSON download just below the graph and it satisfied the use case sufficiently.
If you just want to download the assets and take a look, a workaround is probably leveraging the next/export package. This allows you to run yarn build and generate a static export of your entire site. This should include the file you're looking for.
Just some ideas to think through.

Adding local image in Jupyter SQL notebook

Started using Azure data studio and creating documentation for some SQL processes in our system.
As part of that I need to include a flow diagram in the document. Currently I have uploaded an image to a URL and am able to embed the image in document from the URL.
But is there any way to include an image from a local folder? Please assist.
I think this is what you want.
from IPython.display import Image
Image(filename='C:/your_path/your_image.PNG',width=200, height=100)
I was interested in this also. Syntax should be (if you store images in subfolder relative to notebook):
![ssms_subquery](images/16_ssms_subquery.png)
This didn't work for me initially: rendered as a broken image icon.
Things I tried:
Make sure you have a workspace defined for your root folder. Create the folder, then select "File > Add Folder to Workspace ..."
If that does nothing, try closing and restarting ADS. I've found the rendering to be flaky from time to time after awhile or if you have been opening/closing notebooks a lot.
Related topic has been discussed previously for markdown in general (but worth asking again for ADS!), eg. How to display local image in markdown

LinkedIn share links to PDF documents

I am trying to create buttons on a web page that allow users to share links to PDF documents on LinkedIn. LinkedIn loads a window without any errors but offers no link or preview of the PDF or any indication of what is being shared.
Here are the two methods I have tried. First the plugin method.
<script type="in/share" data-url="http://example.net/DocumentDownload.aspx?Command=Core_Download&entryID=114"></script>
And, secondly with a custom url.
TEST
Encoding the url makes no difference.
The above links are direct document links from a DNN web site using Document Exchange. If I change the urls to any html page it works fine and LinkedIn seems to be able to extract the useful information right from the page and use that for the share details.
Can LinkedIn handle this kind of thing? There is nothing to guide me on the type of links that can be shared. I can't find any information about it. There are no errors in the web console.
Not sure, but you should try to provide LinkedIn with the link that has .pdf at the end, like http://example.com/documents/file1.pdf. I guess LinkedIn just checks the URL if it has .pdf file at the end to decide if it is a PDF document or not.
I have no problem sharing pdf's on LinkedIn. Check it out...
https://www.linkedin.com/sharing/share-offsite/?url=https://www.revoltlib.com/anarchism/the-conquest-of-bread/view.pdf
Works perfectly fine. And view.pdf is a script, not a file, either, so, it's not looking for a PDF file to analyze, so much as headers that indicate you have a PDF file available to analyze, so, in PHP, at DocumentDownload.aspx, we would do...
header('Content-type: application/pdf; charset=utf-8');
This header let's the sharing app know that it can analyze the document as a PDF file and extract useful information from it, as you can see from the screen shot.

download file which redirects?

I've tried to search for this both on Google and StackOverFlow, but simply can't find what I'm looking for, it might be that it's simply not possible, but thought I would ask anyway.
I'm looking for a way to make a file redirect the user to another page, the user would download the file by clicking on a button.
It's for a Prestashop downloadable product, I'm trying to redirect the user to another part of our site (which isn't directly visible) to be able to view magazines, etc. in a viewer.
Now Prestashop is natively set up to download the file, which is what we don't want, hence the use of the viewer, but there is no way to simply provide a link to send the user to instead of a physical file, like a PDF or something. I can't really modify the button as its generated by Prestashop, and if I add a PDF file with the link in there it defeats te purpose as I dont want people having the link in a document (I know they can find it from their history and so on). Hence I thought it would be easier to do it with a document that redirects if possible.
So in short, is it possible to make a file that would send people to a certain web page once they open/download this file on/to their computer?
And if yes, how would one go about it?
Can you make the user download an HTML file? If so, you can use "meta refresh" to redirect the user to your private page.
This does mean the unprotected link will be visible in downloaded HTML file - perhaps you can obfuscate this with JavaScript to make it a little more difficult for users to find your protected URL.
http://www.w3.org/TR/WCAG20-TECHS/H76

dotnetnuke: links to external files not working

We currently are running DotNetNuke 4.0.6. On the portals there are links that we have created to access files located on fileshares. When we set them up and save the page, then when we click that link nothing happens.
I have currently set the link up like this:
Link Type - URL
Protocol - Other
URL - file://///myfileshare/filesharename/folder1/folder2/myitem.pdf
If I select anything else (http, https, ftp) it doesn't work. When I mouse over the link it looks to be rendering correctly.
Can anyone help with why this may be happening? Am I missing a setting or selecting the wrong item?
The text in the editor is this:
Service Station for
Please remember the information presented in the newsletter is confidential and should not be shared outside the company.
Read more... (where "Read More" is the link)
There are a few items that you want to remember here.
Users need to have access to that share, so it is possible that could be your issue
It looks like you have a few extra //'s in your link. Should be file://, might need to switch to HTML view in the editor to modify.

Resources