downloads of multiple urls whose link is stored in text file - netcdf

How to download all files (NETCDF files) using r-studio if I have multiple URLs stored in text documents.
Below is the few links stored in the text documents
https://giovanni.gsfc.nasa.gov/session/39F9EF86-B091-11EA-A9C9-D6FA8C209DB0/0F244A4E-0A0B-11EB-B795-C90803BCD197/0F287C04-0A0B-11EB-B795-C90803BCD197///scrubbed.TRMM_3B42_Daily_7_precipitation.20190301.nc
https://giovanni.gsfc.nasa.gov/session/39F9EF86-B091-11EA-A9C9-D6FA8C209DB0/0F244A4E-0A0B-11EB-B795-C90803BCD197/0F287C04-0A0B-11EB-B795-C90803BCD197///scrubbed.TRMM_3B42_Daily_7_precipitation.20190302.nc
https://giovanni.gsfc.nasa.gov/session/39F9EF86-B091-11EA-A9C9-D6FA8C209DB0/0F244A4E-0A0B-11EB-B795-C90803BCD197/0F287C04-0A0B-11EB-B795-C90803BCD197///scrubbed.TRMM_3B42_Daily_7_precipitation.20190303.nc

You don't have user name and password. So you'll get HTTP Basic: Access denied.
If you need to download some links from .txt try to use jdownloader.

Related

How to programmatically download zip files shared in google drive via form?

I have a google form that accepts file uploads, all of them in zip format.
That form generated a spreadsheet, where each row has a link with a unique uri, that represents a zip. I want to download all of these zip files to disk.
Using gspread it is easy to get all the URIs. However these do not have .zip extensions, and they seem to be google drive paths.
I've tried extracting the ids from the URI and using the requests package to get:
https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID
https://drive.google.com/u/2/uc?id=DRIVE_FILE_ID&export=download
but neither of these approaches seemed to work.
It seems like the URI is linking to a preview of the inside of the zip, but I can't figure out how to simply download it programatically. Clicking on hundreds of links and downloading each by hand isn't really an option.

How to make files available as a download link in asp.net?

In my asp.net website, users can upload multiple files, which reside in 'upload' folder on server's hard drive. I am saving the files by renaming them with username + original file name
Example : if I upload file 'user.text' and my code is 1000, then the file will be saved in upload folder with name '1000_user.Text'. This is for identification of file against a particular user.
Now, when admin logs in application and selects a user, he should be able to see all files uploaded by him/her. Files should be in downloadable format to him.
How can I achieve the same? I have totally no idea, how to go for it ?
This is not how you ask a question on SO. Anyway already a piece of advice :
Store your files OUTSIDE of the webroot, and use a script in your website to get the files and render it to the user. This is for security reason : if someone manages to upload a malicious file, you don't want him to be able to execute it from the web.
Store file info and upload info in a database : who uploaded what and when ? Relying on file name isn't a good idea. You could also store the file in the database eventually (as a BLOB), but I prefer the good old filesystem
I can suggest you couple of ways based on feasibility. Approach 1 - If you can make database changes, when user is uploading a file you should save dynamically generated filename against the user in database. This way when admin logs in and wants to see all the files uploaded by user, you just need to make a database query and show them in a grid. When user clicks on the file name, you can fetch the file from harddisk and allow it to download to admin.
If database change is not feasible, your task will be more difficult. You will have to query in your directory with username in all the files. You can make use of LINQ to make this task little easier to you. Once you have got all the list, show it to admin.
I would recommend you to save metadata about the file on the database (like original file name and username). Then you could use this metadata to find the files that the user have uploaded. Give the files a file name on disk that is based on a unique ID in the database table. That way a user can upload several files with the same name. Make sure that this folder is not located within you application so that they are accessible with a url for security reasons.
The most recommended way to achieve this is to use a database, it is same as a module of Gallery where a user has albums and some pictures in albums. Admin can view each user's album and pictures in the album. you have to introduce two tables in your database. I having the category information of files being uploaded (master table) and other table having the info about the files itself (details table).
The other way is to create a hierarchal folder directory for each user for file categories in your application and then recursively read the directories and fields and then list them up to show them to application users. this would be costly i guess when number of files will increase.

How do I hide xml file?

How do I hide xml file? I don't want to appear the file in google results. How I access denied this file for user?
I don't want to appear the file in google results.
Create a robots.txt file to instruct search engines not to index it.
How I access denied this file for user?
Add in some layer of authentication+authorisation. Preferably the same one as the rest of your site uses.

uploading files - how to store file in non public folder

I have problem with uploading files. I followed these instructions: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html and everything is working fine, but I want to save uploaded files in a folder that is not public and with random name and then send it to the browser in original name.
I know how to put file in non public folder with random name and how to save original name to database, but what should I do next for getting this file content and send it to browser with original name? How to achieve that?
Store the hidden path in the database, then just read it in your php script that is public available and send your file to a user, if you don't how to send files in php, you can find it out here on stackoverflow.

How to display show message to user after Response.close?

In my asp.net web application i have to convert resx file to excelfile and then i should provide an option to download the converted file. I have done the download function using response.Addheader method. Now i wanted to display statics to the user of how many keys are converted from resx file to excel file.
I have placed an label to display no of keys migrated but the code is not exceuted after response.end. Pls help me to get this done
Thanks
Rm
Short answer is that you cannot send some output once the response has closed.
Now to achieve what you want to do, you have to emit statistics along with link to download the actual excel file. For example,
Convert the file and store results into file system. You should use some random key (such as guid) for generating the file name.
Output statistics that you want to show to the user.
In the same output, emit a start-up java-script that would redirect the browser to the url that will download the file generated in step1 - the file name key will useful for creating such URL.
In rare cases where JS doesn't work or re-direct takes more time, The output from #2 should also contain a link that will allow user to download the file manually (the link will be accompanied with some friendly message)

Resources