Getting movie URL from UIImagepickerController - uiimagepickercontroller

When I shoot a video using UIImagepickerController, the movie url which I receive from imagePickerController:didFinishPickingMediaWithInfo: and the url when I receive from the same video after saving to camera roll are different. Can anyone explain why this so?
Many Thanks,
Naveen

All media data within device are stored in Assets Library. You haven't raw access to this storage. iOS creates a temporary copy of movie which you want to use and store it into file accessible from your App.
After movie capturing you get back the temporary path to movie within your device file system. You need to save this file into your assets library (camera roll).
After movie choosing from library you get back the path to copy of compressed movie in device file system and url to assets library.

Related

How to handle Firebase image updates and only download if necessary?

How would you handle images from Firebase to not download them everytime? I would like to check if the image already has been downloaded and saved to memory and only download it if it differs. Identifying it by name would be my last option, because I currently use the name as a human readable identifier for usability reasons.

How To pull photo down and display it from firebase?

I am making a react native app with expo and firebase. I have uploaded photos to firebase successfully as a blob but want to be able to pull the photos down from firebase and display them to the user. I need to be able to display the user's profile photos whenever they log out or back into the app.
I am not finding any documentation in Expo/React Native/Firebase about downloading. I am only seeing docs on uploading and blobs.
Can anyone point me in the right direction? Is uploading the blob form of the photo and downloading it the correct way to save photos from a user's phone to the database?
These are the resources I have reviewed:
https://firebase.google.com/docs/storage/web/download-files
https://docs.expo.io/versions/latest/sdk/imagepicker/
https://github.com/expo/firebase-storage-upload-example/blob/master/App.js
https://forums.expo.io/t/uploading-images-without-react-native-fetch-blob/981/7
The Cloud Storage SDK from Firebase for JavaScript doesn't have any methods to directly download the bytes from a file.
The way to download the data is through the download URL. So you first get the download URL of the file you're interested in, and then download the data with for example an XMLHttpRequest (as shown in the example in the documentation), or with a similar method for your platform to download data from a URL. For expo the latter seems to be FileSystem.downloadAsync(...).

Shiny image hosting

I have been trying to make a very simple app using shiny that basically does this:
Let's users upload a photo
Downloads a csv file with the public links to each photo (this is to be used by shopify to download the images and re-upload to their servers)
I am having trouble doing the second part.
Both Dropbox and Google Drive let me store objects using their API and r packages, but they have deprecated a url to the direct object, instead opting for a "preview" version of the file, which of course makes shopify go crazy and reject my url.
Any thoughts as what other storage service or workaround that can work?

Make files public from Google Compute Engine

I'm running RStudio server on an instance of Google Compute Engine. My RScript creates a map file that I would like to include in a public web site.
The file gets created OK.
Separately, I've also created a bucket and can upload images to it, viewing them from a web browser with a URL like this: https://storage.googleapis.com/...
Still, I'm confused as to how to make the image created by the R script viewable by a browser. Does the image have to find its way over to a bucket? Or is it viewable where it is somehow?
There are infinite possible solutions depending on what you want to implement and how much time you want to spend on it (and if you are the only one accessing or not and if you can share the file or they are sensible), therefore I will provide you some hints:
The easiest one is to upload the file to a Google Storage Bucket, then you can control who can access that link (a single user, a domain or everyone), it could be access by accessing with the browser with the following link:
https://storage.googleapis.com/namebucket/folder1/folder2/nome_file
There is no graphical interface, you will need to know the address to download the file (at the end it is enough to know the name). You will need to create a small script to make sure every time a image is available to upload it to the bucket and to make it public available. Or you can decide to make he bucket itself public.
The second possible solution is to do the same but to create an html page REALLY simple, basically a list of links to the files in the bucket, each time you upload a file to the bucket you update the html file. At least you would solve the issue regarding the knowing the names and you can navigate it a bit.
<html><body>
This is a link
</body></html>
If you need to expose the resources to more people, or you would like to have something more "nice" graphically you will have to spend more time and build a decent frontend. You can follow thousands of different approaches.
You have really thousands of possibilities.
P.S.
Documentation regarding uploading a file to bucket.
Documentation regarding managing access to file stored.
Notice that in this way depending on the extension of the file you want to share the browser behaves differently, a .txt, a .jpg are shown an .exe is downloaded.

Flex multiple file upload in one HTTP Post

Going over the file references in a FileReferenceList calling upload on each one means the files are uploaded as separate requests.
I want to upload a bunch of file in one POST (and I already have a ASHX handler that will accept it).
Any ideas?
AFAIK that is not possible.
From the docs:
The FileReferenceList class lets the user select one or more files to upload to a server-side script. The file upload is handled by the FileReference.upload() method, which must be called on each file that the user selects.
...and...
Uploading multiple files requires you to upload each of the selected files by using FileReference.upload()
You could perhaps create a zip with the AS3 zip library and send that to the server.
No you cannot, its a security restriction of the Flash player. You can simulate File upload with Action Script (usefull if you want to send data but no User files).
Its the same with Flash 10, so maybe on Flash 11...

Resources