Upload to vimeo using 'streaming' but do it directly like 'POST' - vimeo

I have a code which lets the user upload a video file to my vimeo pro account. By using POST as the upload method, the user can upload large video files and bypass my web server php file upload limits and restrictions.
However, by using the POST method of the vimeo upload API, I have less control over the upload form because the file upload field is being returned from vimeo and in my situation, I want to use my own file upload field with some text fields to construct the video title.
I tired using 'streaming' before, in order to use my own file upload field, but could not upload files larger then my server limits. Only recently I found out there might be a way to use 'streaming' and still bypass my web server file upload limits, thanks to #Dashron who helped me here: https://wordpress.stackexchange.com/questions/165378/uploading-video-to-vimeo-using-its-api-while-bypassing-php-server-limits
Is that possible? If so, how do I do that or where do I read about it?

Take a look at the PUT upload documentation : https://developer.vimeo.com/api/upload#http-put-uploading
And the HTML 5 File documentation : https://developer.mozilla.org/en-US/docs/Web/API/File
This is how Vimeo's on site uploader works. Unfortunately I don't have a ton more information at the moment, but there will be improved documentation in the future!

Related

Saving files on local machine by Chrome app

My chrome app needs to save a file with human-readable or standard format such as SQLite (It should be readable outside Chrome).
Is there any API suitable for this purpose?
Some files with .localstorage extension (SQLite format) are in Chrome\User Data\Default\Local Storage folder. Is it possible to create such files by the app?
Edited: The app should not ask user for extra permission.
Thanks for your consideration.
chrome.fileSystem API is what you need.
You will need to ask the user at least once where to save the file, but then you can retain the entry to write again to the same file/folder.
There is no way around asking the user to "escape the sandbox".
You'll want to use the Quota Management API. This is per-origin storage, and you request specific amounts of quota.
It sounds like you also want your users to open the files directly? There's an HTML5 filesystem explorer Chrome app that you can use. It'll show you the files, and you can figure things out from their URLs (e.g. I'm currently using filesystem:http://localhost:8000/temporary/bar for a local experiment).
Or are you looking for something more user friendly? I think you have to use file save in that case, the same way Google Drive does.

How to write Files from a HTML File in a DropBox

My knowledge about Web technologies is very low and I just wanted to know if the following scenario would be possible with HTML5 and Javascript:
If I host an HTML file in Dropbox and send this link to seomeone, would it be possible that this HTML file creates a new file in my Dropbox? For exampe the HTML file is a form that one can fill out, can the HTML file create a text (.txt) file with the form content?
As far as I understand, the HTML file has to be hosted by a webserver and has to allow Javascript or PHP to achieve this. But maybe there is a way to just use an HTML file, a dropbox and a browser?
Any hints what topics I should study to achieve this goal?
On what I've understood from Dropbox, it does not directly show you the file contents in any manner. You can store files there, but the only thing you can see when opening a link that directs to the file, is the page which allows you to download the file to your own PC and save it.
This would seem like an impossible thing to achieve, in any cloud service like Dropbox it would seem. I would recommend you to just get the web hosting service, they are usually not that highly priced after all.
You could do this, but you shouldn't. To make this work, you'd have to use the Dropbox API to upload files, and you'd have to embed in your web page an access token for your account. That means anyone who looked at the source of your web page could get access to make changes in your account (e.g. delete all your files). So there's no safe way to do this without a server-side component (like PHP).

Replacement for fileEntry.toURL() in Chrome Packaged Apps

I'm using the HTML5 FileSystem API in a Chrome Packaged App to write to a log file. I want the user to be able to download this file, so I tried something along the lines of:
fs.root.getFile('log.txt', {create: false}, function(fileEntry) {
var url = fileEntry.toURL();
// do something with the file url
});
This doesn't help though, because the URL is something like filesystem:chrome-extension://eekedjcagggbfigdmifkmhkjbhiklnpj/temporary/log.txt and it's not possible to open it somewhere.
What technique would you recommend to make a FileSystem API file in a Packaged App downloadable?
Edit: After reading through Ben Well's answer below, I realized that I'll have to clarify even more what I want. It would seem especially nice to me if there would be a technique that doesn't imply loading the HTML5 Filesystem API file contents, building a blob from it and writing that to a user-chosen path with chrome.fileSystem API.
Have you tried using chrome.fileSystem.chooseEntry? This API lets your app save files to the user's hard disk, wherever they want, letting your program have a Save As kind of command. This is a bit different to a download link, but is also more in harmony with V2 apps being like native apps.
chrome.fileSystem pops up a dialog asking the user to choose a location for a file. If you use the options for saving files, this returns you a file entry that has permissions to write to the location chosen by the user. The user can also create new files when you use these options.

Save pdf inside html5 local storage

I am using mozilla pdf.js to read and display content of a pdf file on browser. Later i thought to take this functionality offline and make use of local storage.
Till now i am able to create an offline app which makes use of manifest to make my app offline but the real challenge i have is how to read the pdf which is lying on my server.
Is there any way to save that pdf inside the local storage or any other way to save pdf data as blob inside local storage and then make on fly pdf using blob data.
Kindle cloud reader has this functionality but i am not sure how they are doing it.
Also i am not looking for code ( if any one can show the code that will be great ). Just guide me to the right direction because i know it is possible.
You can use indexed DB.
http://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/
http://msdn.microsoft.com/en-us/library/ie/hh779017%28v=vs.85%29.aspx
Also work on your accept rate..seems too low..

Is it possible to open a users local file for read using HTML5?

I have a path to a file on the users local system. When the user clicks on that path, the file should open so that the user can view it.
I know that there are lots of limitations on this since we cannot access a users local file due to browser security issues.
Now, I read about HTML5 and it's FileReader API, but all the code examples I see online select and upload the file, and I'm not very clear about whether it is possible to do what i want with it.
Maybe I haven't looked at the right places yet, but anybody know about this?