How to download or list all files on a website directory - html

I have a pdf link like www.xxx.org/content/a.pdf, and I know that there are many pdf files in www.xxx.org/content/ directory but I don't have the filename list. And When I access www.xxx.org/content/ using browser, it will redirect to www.xxx.org/home.html.
I tried to use wget like "wget -c -r -np -nd --accept=pdf -U NoSuchBrowser/1.0 www.xxx.org/content", but it returns nothing.
So does any know how to download or list all the files in www.xxx.org/content/ directory?

If the site www.xxx.org blocks the listing of files in HTACCESS, you can't do it.

Try to use File Transfer Protocol with FTP path you can download and access all the files from the server. Get the absolute path of of the same URL "www.xxx.org/content/" and create a small utility of ftp server and get the work done.

WARNING: This may be illegal without permission from the website owner. Get permission from the web site first before using a tool like this on a web site. This can create a Denial of Service (DoS) on a web site if not properly configured (or if not able to handle your requests). It can also cost the web site owner money if they have to pay for bandwidth.
You can use tools like dirb or dirbuster to search a web site for folders/files using a wordlist. You can get a wordlist file by searching for a "dictionary file" online.
http://dirb.sourceforge.net/
https://sectools.org/tool/dirbuster/

Related

How to extract whole html with complete styling after when user designed their page on my website?

Like weeebly, Wix i want to make a website on which user can be able to design their web page with predefined controls and styling. So how can i get or extract whole web page's html with complete styling ? please mention any link or solution
If you are using linux or mac, then I'd suggest using wget. As long as the website isn't blocking these types of download requests wget will download the entire website including resource files (-r) and create the folder structure that would make sense.
wget -r -p -e robots=off http://www.example.com
If the url you want to retrieve blocks this sort of download request, you'll then only receive the index.html using wget.
On windows I use https://www.httrack.com/ It's free and downloads the website just fine. Believe someone has created a windows version of wget as well.

Download files from google drive via URL

We are planning on opening a company account on google drive which will be accessible to only company people.
The issue is we want to put several files on our drive and download them programatically. We tried using google drive APIs but the download speed it very low.
Then we also tried wget but that requires that all the files are made public which we cannot do.
Is there any way to use wget with credentials which will allow a file to be downloaded via an URL.
Our typical file size is 50GB.
There is actually a command from wget to specify user and password. Have you tried the following?
wget --user='username' --ask-'password' https://docs.google.com/'ItemType'/Export='DocumentId'

How to load local resource in Chrome App

In my Chrome App,I want to load local resources such as audio from user's disk.
If I add the absolute path in my code, the Chrome says "not allowed to load local resource"...
So,how to achive it? Thx
Please this is app not extension.
Chrome Apps are not allowed to access the user's file system directly. file:// URLs are forbidden, as are all the other ways you might try for accessing a file like /home/user/music/demo.mp3. This is by design (so users can install a random Chrome App and trust that it isn't going to read or write their files).
However, Chrome Apps have several APIs available for accessing sandboxed file systems. Since your example is an MP3 file in /home/user/music, you probably should use chrome.mediaGalleries, which will prompt the user for access to common media directories (like /home/user/music) at install time. Then you will be able to access certain file types in certain directories, and prompt the user for music and images in other directories.
As sowbug suggested, you could also use chrome.fileSystem, where you can prompt the user to open a file or directory of their choosing. This will give you access to all files in those directories, but you should only use this if you want non-media file types.

How to allow-file-access-from-files in Chrome?

I am using Chrome to test some of my WebGL texture programs. According to the book 'WebGL Programming Guide', if I need to access files from my local disk, I should add the option --allow-file-access-from-files to Chrome.
How do I do that?
The short answer is DON'T
Open up a shell/terminal/command line and type
cd path/to/htmlfiles
python -m SimpleHTTPServer
Then in your browser to go
http://localhost:8000
If you find it's too slow consider this solution
The reason you don't want to allow file access is allowing it can be used to steal data from your machine. For example, you go to a site and download some webpage. You then view that page locally. With file access on that locally run page can now access all your files AND upload them to a server.

html showing contents of folder

i am creating a web page to show the contents of a folder so that people can view the files and download them if needed.
Click here to view Folder
But i wanna do this without any coding what so ever, i found this code which lets me view files.
The problem i am facing is that when i double click the html page and open it this hyperlink works and i get what i need but when i access the page through a server (IIS 7) then the hyperlink does nothing ?
am i to set some permissions or what ?
can someone tell me what im doing wrong ?
The link will work when the file you want to download is on your own personal computer, which in your case is true if you're just showing the HTML file locally. It won't be true for users visiting your website from another computer though.
If you want to serve the file on a server, you need to link to the path on the server itself, that is, if the file is in C:\inetpub\wwwroot\test_pages, your A HREF looks like this:
Click here to view Folder
Offcourse, this will work for simple files. For folders, you need to enable the webserver to show directory contents by enabling Directory Browsing.
There are security implications of linking to a local file from an online source. It works when the page is held locally but when on a server it puts a stop to it.
You can also use linux build-in command Tree, in example below you can see that i only want to add files that are matching .tar.gz or .zip or .tar.bz2
tree -P "*.tar.gz|*.zip|*.tar.bz2" -h -D --dirsfirst -r -H . > index.html;
You can also add a custom css to the page for a better looking output.
Straighforward and highly secure since the result is only html
as you use windows you can use www.cygwin.com to emulate a linux environement