File inherits from FileReference. Just use File.load(). (Although I've always loaded files using FileStream.)
Thanks Joe, so what I'm looking to do is upload a file on the filesystem
without having to select it via browse(). I'm assuming I'll have no
problems calling File.upload() then?
Correct. You shouldn't have any trouble.
aahh i found my problem. i tried all of this earlier but it wasn't working.
i was instantiating MediaPromise, but didn't notice the error until
debugging on the device thanks Joe!
hey Joe, so I got the whole process working and it's really cool. one odd
thing is that i get an IOError for the upload, yet it does actually
succeed.. here's the video shot on the tablet and uploaded
http://www.youtube.com/watch?v=wfcWxKlleDk but i got an IOErrorEvent
returned on the File object..
The video is too blurry for me to read.
If you want to put your app on iOS, be aware that the media promise doesn't give you a File object to work with. You have to read the media data into a byte array and either upload that directly (or create a temporary file). I just wrote an article on the topic. I only tested with still pictures, but the same considerations should hold for video.
The video was only demonstrating that the upload actually completed just
fine, sorry for the confusion on that. So, as you can see the upload works
because the video is on YouTube - the problem is rather than getting the
COMPLETE event I got an IOErrorEvent which is strange since the upload
succeeded. See what I'm saying?
No plans for this on iOS, but thanks for the info!
The video u see was taken from the tablet by my app so it's already working just great. Only problem is rather than a COMPLETE event I get an IOErrorEvent - even though the file obviously uploaded fine - as shown by the YouTube videos existence. See what I'm saying?
Sent from my iPhone
Did another test and it worked again, but this time I captured the error.
"Error #2038: File I/O Error. URL:
http://uploads.gdata.youtube.com/action/FormDataUpload/AIwbFAQ88mh1D8ofSt8u5C6O3yZ0Xcg7P0t Mq5M3k3y46rHaeRo6_fi91oNIGxEyZMygCttfWcQUVkkdvs7E7X679HuPb1PCKw?nexturl=http%3A%2F%2Fwww.d esktube.tv%2Fupload-complete
This was a 27 second recording, and again posted just fine: