[SOLVED] seeking tool to help with file download placement
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I go to the web looking for all sorts of information. Yes, I also look for music and images and videos. I'm looking for some sort of utility or browser extension that will help me sort out all of these downloads.
The tool might work like this:
I request a download of some file, say mumble.pdf
The mime type, coupled with the file extension, tell the utility what sort of file I'm grabbing.
While I sometimes get the options to SaveHere when I request a download, usually the files end up in the default download folder.
Instead, I'd like to tool to see that I'm grabbing a PDF, and download into my designated book-reader shelf folder.
Someone suggested that I run a daemon process to watch the default download folder, notice there are new contents, then move those contents to where they belong. I tried a 'cron job' but there was so much delay waiting for things to move. I don't want some process polling the download folder. Perhaps if there is some way to learn that files were written into a folder and start the crank then.
Although it might be possible to do so I do think your described approach makes it harder then expected/needed. One of the first problems that comes to mind; If this tools runs on a regular base, it needs to make sure that the downloads are finished before moving them to a specific destination.
Why not simplify things and create a (shell) script that can do this job for you and run it whenever you feel like it and the system isn't downloading.
This approach will also make sure that it isn't paired with a specific program (browser, (s)ftp, scp, wget, etc...), it will look in one (or more) specified directories.
You might go as far as to run this script at boot.
For Firefox you can use Download Sort extension. But external script, like druuna said, would be better - it not works only with Firefox. This approach has advantage when you want to skip moving big files between partitions.
I think a script that you could call on to "open" the download files directly from the browser, instead of the default mime-type option, would be even better.
I'm not completely sure about how to go about this at the moment, but I believe that browsers generally just save the file to /tmp or someplace similar, and pass that file location on to the program. So the script would probably just need to read the filename, analyze its type, and move it to the proper preset location.
I think a script that you could call on to "open" the download files directly from the browser, instead of the default mime-type option, would be even better.
Agreed that a browser extension (or "plug-in" or "add-on" or whatever) makes a lot of sense. Primarily because most download activities are a direct result of browser activities. If I'm doing something else, 'wget' or similar already lets me steer the placement of the fetched file artifacts.
Quote:
Originally Posted by David the H.
I'm not completely sure about how to go about this at the moment, but I believe that browsers generally just save the file to /tmp or someplace similar, and pass that file location on to the program.
Every browser that I work with, including Android based browsers, have configuration of a default download folder. I've not discovered the why or how, but on occasion, I get a dialog that asks "where to save" the file artifacts during the download. I don't recall doing anything unusual to provoke this dialog or else I would use it routinely.
Quote:
Originally Posted by David the H.
So the script would probably just need to read the filename, analyze its type, and move it to the proper preset location.
I started a parallel thread Seeking Help With Script Writing to discuss the coding in detail. In short, there are two parts to a solution
scan the download folder and move files to their destination
discover when there is work to do and launch the scan
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.