FAQ Database Discussion Community


Creating a python program that scrapes file from a website

python,html,downloading
This is what I have so far import urllib...

Ruby - Save file parts before download finishes

ruby,downloading,download-manager
I was looking at downloading scripts in Ruby and most of them end up like this : File.open(fileName, 'wb') do |output| open(@url) do |data| output.write(data.read) end end this approach seems to open a stream and download the file completely and FINALLY save the data to the file... Is there a...

How can i download with watir webdriver?

html,ruby,watir-webdriver,downloading,webautomation
Here is the code on their website but I'm not understanding what to do exactly. I'm still considerably new to Ruby. download_directory = "#{Dir.pwd}/downloads" download_directory.gsub!("/", "\\") if Selenium::WebDriver::Platform.windows? profile = Selenium::WebDriver::Firefox::Profile.new profile['browser.download.folderList'] = 2 # custom location profile['browser.download.dir'] = download_directory profile['browser.helperApps.neverAsk.saveToDisk'] = "text/csv,application/pdf" b = Watir::Browser.new :firefox, :profile => profile...

disable downloading of image from a html page

html,image,downloading
Suppose there is a html page containing some images. we want to disable the downloading of the images from user side. Is that possible? Should I need to use any javascript or add some attributes in <img> tag? My current code is <td><img src="images/handmade (1).jpg" class="img-responsive" alt="" /></td> </tr> </table>...

How to download mp4 file via http headers

php,http,http-headers,mp4,downloading
I've got a mp4 file saved on external FTP server. When I save it over "Save video as" when I play this video in classic HTML5 player, everything is ok. But when I download this file over this headers: header('Content-Description: File Download'); header('Content-Transfer-Encoding: binary'); header('Content-Length: FILE_SIZE'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0');...

Error: Downloading broken file by fread in php

php,http-headers,fread,downloading
I tried different codes to download files from php. fileread() give issues so, that is not even an option now. I am trying to use fread() now, But the problem it gives is that when you download a file, that file never works. I download broken file. For example if...

how to allocate file in disk to write data c++

c#,c++,downloading
I'm trying to use curl to download data from internet with multi-part simultaneous using multiple thread. However, I have problems when the download is done, I must merge all the parts together, and this wastes memory and take too long. I see Torrent and Flashget using this technique whose name...

how to check whether a program using requests module is dead or not

python,web-crawler,downloading
I am trying to using python download a batch of files, and I use requests module with stream turned on, in other words, I retrieve each file in 200K blocks. However, sometimes, the downloading may stop as it just gets stuck (no response) and there is no error. I guess...

How to return file data securely in PHP

php,ios,json,downloading
Bottom line question: What is the correct PHP so that I can include a binary data file in the json based response object? I have an (iOS, though it shouldn't matter) app that's communicating with a server. I want the server to return a file on successful login. I do...