Multithread http file uploads - html

Is it possible to multithread file uploads using http post requests (not ftp)? Are there any flash or java uploaders that take advantage of multithreaded uploads?

It is possible, and I'm sure there are several Flash and Java applets that supports it. It's just a matter of creating separate connections. Here's one of the results I found using Google:
http://www.uploadify.com/

HTML5 MultiFile uploads and this is example:
http://safron.su/playground/html5uploader/
P.S. This example is designed to load the picture.

Related

Linking to S3 file without URL - Rails - aws-sdk

I have an S3 account, on which are stored videos which I need to play using an HTML5 Video element inside a rails application.
Is it possible for me to be able to load the videos into the player without making the video public and directly linking to it?
I have the gem aws-sdk and I read through the documentation and didn't find any information about this.
Excuse me? How is it unclear what I'm asking? It's not really possible to make it clearer so I guess I'll basically restate what I already said.
I need to be able to this:
<video src="<url of file on S3>"> without making the file public in S3 so anybody can download it.
Look ar presigned URLs. Use the Presigner in the ruby sdk on the server to generate a presigned URL (for get method) for the key and insert that into the html.
There is an article page about doing this using the aws-sdk.
http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjectPreSignedURLRubySDK.html
I've only ever used Paperclip to do so.
https://github.com/thoughtbot/paperclip/wiki/Restricting-Access-to-Objects-Stored-on-Amazon-S3
To access private content in S3 from your rails application, there are multiple approaches available
Create a Sign URL using Ruby AWS SDK from your Rails Backend and return the URL to the browser so that your HTML5 player can access them
Using AWS STS and AWS Ruby SDK at Rails Backend, generate a temporarily access token (Which has grants to s3 bucket) and return it to the browser, where browser can use AWS JS SDK + Token to request the file
For better performance use AWS Cloufront RTMP distributions for the Videos which serves the files from S3 with Signed URLs and Origin Access Identity limiting public access

how does torrent streaming works using html5?

I stumbled upon this site and I wonder how does it work? I mean the streaming part
I don't think it is torrent streaming. I think it is regulat file streaming. And this file downloads with a torrent client on server side.
For example you can set uterrent (it supports downloading with first parts priority) to pickup new torrents from some folder. It start download automaticly. All you need is start stream this file for user when there is enough data downloaded.
It's not html5 !
All videos are downloaded to servers using NodeJS Web technology.

How to open html link to local file in its default program, NOT browser?

Basically, I'm creating a webpage filled with images of movie posters that link to video files, as a means of making a more visually-appealing form of my local video library.
I'm using
<a href="C:\blah\movie.mkv"><img src="poster.jpg">
It works exactly how I want, HOWEVER, it opens the file in the browser rather than opening it in its default program, as I would like. I would like each link to open the file in the program titled "VLC Media Player", as specified in Windows for each of their filetypes.
Let me know how I can do this (in the simplest form--I'm not too smart :P)
Thanks!
If you are creating web pages on your local system for you own use then you may want to consider looking in to a WAMP server setup. This uses php and should allow you to call VLC using the exec command. Would take some learning however.
There is very little you can do to control how a client will handle a resource.
You can use the Content-Disposition HTTP response header to state that the resource is an attachment (and thus recommend that it be downloaded instead of opened).
Content-Disposition: attachment;filename="movie.mkv"
You can't, however, stop browser native support or a plug-in from handling something instead of having it open in a separate application (let alone cause it to be opened in a specific application).
If the browser is configured to open video files internally, then nothing the author of a website can do will make it switch to using a application instead.

How to create HTML5 100% offline applications?

Sometimes I need to write a small program just to represent some data in a chart, or similar stuff. I have been wanting to do this kind of things through the browser, with HTML5. I think it would be nice to use its canvas to create a nice UI for simple apps.
I have read some articles related to offline applications with HTML5, but they focus on downloading all the data you need and save it to the cache to use it offline later. You even need to set up an Apache server (or similar) to create your app.
I don't need my app to be online, just in my computer. I just want to create a simple application, nothing to do with internet at all.
How can I do this? Is it even possible or worthy? Is there any "Hello world!" tutorial about this around there?
Something like Mozilla Prism would be good for displaying the content as an application.
There's no need to have a web server like Apache for just displaying HTML5/Javascript in a browser. You can just have it all in a folder on your desktop and then load it in the browser with the file:// protocol.
For example file://C:/Documents and Settings/YourUser/Desktop/YourApp/index.html would open an HTML file in a folder called YourApp on your user's desktop.
If you ever find you need to read static HTML+Javascript files locally then I'd recommend using this python command in the console:
python -m SimpleHTTPServer
It launches a simple HTTP server (who'd of guessed) that serves files from the current working directory. Effectively, it's the same as launching an apache webserver, putting some static assets in /var/www/... etc. etc.
You could also just browse to the assets at file:///some/folder; however, most browsers will prevent javascript from using AJAX when files are loaded in that way, which will manifest as a bunch of bugs when you go to load it.

Can an AIR app be programmed to handle a URL protocol?

I'm writing what is essentially a browser in Adobe AIR (ActionScript, not AJAX). A great bit of functionality to implement would be protocol handling. iTunes, for instance, handles itms protocols; when your friend sends you a link beginning with "itms://", it's going to launch iTunes as long as it's installed. Is there a way to write an AIR app (requiring AIR 2 would be fine) that can be the "handler" for a protocol in this way?
There is no way, programatically speaking, to specifically handle a particular protocol. However, there is InvokeEvent. InvokeEvent will be fired when the application is "invoked", either when it's explictly launched or if an associated file or URL is activated.
The process of associating your app with a particular file type or protocol scheme is separate and application-dependant. In iOS, for example, you would need to specify the protocol in Info.plist under CFBundleURLTypes/CFBundleURLSchemes.
Yes. You can use the URLLoader class to download data in binary form (URLLoader.BINARY) and then parse this as appropriate. See this CS3 documentation on working with external data.
http://www.patrick-heinzelmann.de/labs/lastfm/
I'm not sure exactly how it works and I don't see a way to download the app, so I can't even test it, but maybe it will help...
Check out this page. I am trying to find out the same thing, but I haven't found any solution to do it with just Air yet. Seems like you might need a custom installer to setup the correct registry entries, and a proxy application to "wash" the input to a correct format that then can start your application with the correct command line parameters. Hope this can be of any assistance.