First, sorry about my english.
So, i have a site with some zipped components (.tar.gz) and i want to make a plug-in for download this components.
Actually my plug-in make the component download, but it's instable.
I using the follow code:
- Code: Select all
def download_product_http(param_1,param_2,param_3,param_4,dialog,param_5)
Net::HTTP.start(RESTRICTED_HTTP_SERVER) { |http| # SET HTTP SERVER FOR DOWNLOAD
response = http.request_head(URI.escape(LINK)) # SET THE LINK AT THE HTTP SERVER
file_size = response['content-length'].to_i # FOR PROGRESS BAR
open(product_tar_gz_name, "wb") { |file|
http.get(URI.escape(temp_link)) do |str|
file.write str
# CODE FOR INCREMENT PROGRESS BAR AT WEBDIALOG
end
}
}
end
This code works well for tar.gz files until 1 mb, when the size of the files exceeds 1 or 1.5 mb SKU crashes... i really dont know why...
I've tried using the "model.definitions.load_from_url(url,handler)" but this works only for SKP files.
I've looking for something more simple, someone with any idea?
Thanks.
Felipe

