how can we extract and read grib2 files from url with octave?
url like this: https://dd.meteo.gc.ca/model_gem_regional/10km/grib2/06/003/
thank you
Related
I've been trying to manipulate a file that's base64 encoded that I'm recieving from my client.
I'm currently using https://github.com/zdavatz/spreadsheet/blob/master/GUIDE.md to manipulate it, however, there doesn't appear to be any way to open a file directly from the base64 blob, or should I write it and then read from it? can't that a potential security threat for the server?
for example, if I recieve a file :
file = params[:file] with contents:
data:application/vnd.ms-excel;base64,0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAOwADAP7
(should I remove the data:application/vnd.ms-excel;base64, ?)
I'd like to open it with this:
Spreadsheet.client_encoding = 'UTF-8'
book = Spreadsheet.open "#{Rails.root}/app/assets/spreadsheet/event.xls"
(or with a blob or temp fle)
Sorry if it's pretty obvious, been looking for hours and there's not much info about it available, tried creating a temp file first but I don't think that's supported and there's not much I can get from the docs.
Shot in the dark: Maybe decode it, write to binary-enabled tempfile, and then feed that to Spreadsheet?
tmpfile = Tempfile.new.binmode
tmpfile << Base64.decode64(params[:file])
tmpfile.rewind
book = Spreadsheet.open(tmpfile)
I want to download the zip file from eBay. Using downloadfile api.
response = RestClient.post(url,xml,headers)
This call return the content of zip file that is not exractable in xml I think. So i want to download zip file as it is from eBay.
My code is:
headers = {
"X-EBAY-SOA-OPERATION-NAME"=>"downloadFile",
"X-EBAY-SOA-SECURITY-TOKEN" => access_token_lister,
"X-EBAY-API-SITEID"=>"0",
"Content-Type"=>"application/zip"
}
url = 'https://storage.ebay.com/FileTransferService'
xml = '<?xml version="1.0"
encoding="utf-8"?> <downloadFileRequest xmlns="ebay.com/marketplace/services">; <fileReferenceId>6637191637</fileReferenceId> <taskReferenceId>6474385857</taskReferenceId> </downloadFileRequest>'
The documentation for the API used above can be found here : http://developer.ebay.com/devzone/file-transfer/CallRef/downloadFile.html
You will have to pass the content of the response to a library like rubyzip. Then use it to extract your files from the zipped file. This you can do by first writing the file to disk, and then reading it using rubyzip.
Specifically look at this part of the documentation of rubyzip - Reading a Zip file to accomplish what you are trying to achieve.
how to create a url to a file on my computer that can be downloadable from everywhere something like:
http://111.111.11.11:80\Users\MYDESKTOP\Desktop/file.zip
or
https://111.111.11.11:443\Users\MYDESKTOP\Desktop/file.zip
or
ftp.111.111.11.11:21\Users\MYDESKTOP\Desktop/file.zip
is it possible?
I'll be wonder if you tell me how phpfox handle URLs?
In details i want to know that which function gererates urls in PHPFox?
I have some problem with encoding or decoding of PHPFox. Because it transform some urls which is in Persian language to ??????.
For example it will resolve this link: 'http://www.mydomain.com/photos/اخبار/' to 'http://www.mydomain.com/photos/???????/'
This is the main library class for URLs: /include/library/phpfox/url/url.class.php
Is this what you are looking for?
I'm trying to download files which have no Normal [FILENAME].[EXTENSION] in URL, Using AsyncRead Downloading Method. There is no problem in Downloading process (It is Downloading file completely and save the file into Temp files). So i want to get Real Filename with Extension to save it to another place same as original file which is for downloading.
I can get file name while the URL is something like this:
Http://Host.com/Path/MyDoc.txt ( So i can get File name "MyDoc" and extension ".txt" easily because it specified at the URL )
But when downloading URL is something like this:
Http://Host.com/Path/download.php?File=9
I can not get the Real File name and Extension. Is there any way to get them on URLs like this?
Note: There is no problem in Downloading Process and I can download both of above files Completely. I Just want to get Filename and Extension.