Hi i am using sync api to sync my app data to DropBox. Now i want to list and download(import) images from DBX(i can't use core api because i already used sync api). DBFileSystem only works after first sync complete so i added observer to DBFileSystem its called with completedFirstSync value false. This error also coming
"[ERROR] ERR: DROPBOX_ERROR_NETWORK: cfhttpbinding.c:363: CFHTTP Read Error: (kCFErrorDomainCFNetwork, 2) and completedFirstSync remains false"
In my case user link with DBX then list the images from DBX then download which one they want.
How can i acheive this using sync api?.
Related
I am using the URL
http://itunes.apple.com/lookup?bundleId=com.myCompany.myApp
to get a JSON file with the information about my app. This works if the app is already published on the App Store but I am still developing it and the result coming from that URL contains just this:
{
"resultCount":0,
"results": []
}
I have tried to use
http://sandbox.itunes.apple.com/lookup?bundleId=com.myCompany.myApp
and
https://sandbox.itunes.apple.com/lookup?bundleId=com.myCompany.myApp
and I receive
Http/1.1 Service Unavailable
Any ideas?
It's not possible to do that. I'd suggest using another way to get the data you need or mocking the response you expect while the app isn't available and forward the request to Apple as soon as data is available.
Whenever I upload an image to Firebase Storage, the file is only accessible through "download link".
What if I want anyone to access this file?
If I go to Google Platform Storage and enter the same bucket that Firebase uses, I can see that the "Public link" is unchecked.
How can I let this be automatically checked when photo has been uploaded?
Such actions can be done through Google Cloud Storage API, but there doesn't seem to be any option for this through Firebase.
Also, all images that are being uploaded via Firebase has a Content-Type of "application/octet-stream".
Since I am uploading an image, I would like this to have either "image/jpeg" or "image/png". Is there a way to change the metadata?
UPDATE: Reason why I am asking this is because if one create an app with an Instagram like feed of thousands of images. Requesting a download link for each image that is being fetched is unnecessary since the images in questions should already be open to public by default. Firebase file upload prevents this and each user therefor has to make one request per image (which can be tons of images per app launch). Firebase Flame subscription plan for instance has a limit of 100,000 downloads/uploads per month. This makes it unrealistic to create an image feed with thousands of users with thousands of image request each. Files should have the option to create a public link during upload, just as the Google Cloud Storage API itself.
There is no configuration to automatically check the public access checkbox of Google Cloud Storage for files that are uploaded through Firebase Storage.
That said, you could write a Google Cloud Function that triggers when a file is uploaded and that then changes the properties of the file, specifically, you'll want to change the object ACLs to be publicRead.
But since the download URL that Firebase generates for you is already publicly readable, I'm not sure what you gain by checking the box. Is there a specific use-case that you're looking for that isn't covered by simply sharing the download URL?
On the second part of your question, check out the File Metadata section of our docs, which shows you how to set the content type of a file:
// Create file metadata to update
FIRStorageMetadata *newMetadata = [[FIRStorageMetadata alloc] init];
newMetadata.contentType = #"image/jpeg";
// Update metadata properties
[myRef updateMetadata:newMetadata completion:^(FIRStorageMetadata *metadata, NSError *error){
if (error != nil) {
// Uh-oh, an error occurred!
} else {
// Updated metadata for 'images/forest.jpg' is returned
}
}];
Metadata can on added on upload as well, so there's no need for a second request.
History:
I am working on a project for which we need to support:
Background Upload of files using NSURLSession.
The server expects file to be uploaded using Content-Type: multipart/form-data
Previously, I was using NSURLConnection with bound pair of Streams as depicted in this Apple Sample.
Now, I wish to follow similar approach with NSURLSession(Background Session) by using uploadTaskWithStreamedRequest:.
I have written a small stand-alone iOS Sample + a PHP server to validate my concept.
Problem: Everything works if app stays in foreground, but if during upload I press the home key, the upload fails after some time with error:
Domain=NSURLErrorDomain Code=-997 "Lost connection to background transfer service"
Also a little before the upload fails the Write/Producer Stream's NSStreamEventEndEncountered is encountered.
Note: I know the work-around where I can write whole HTTP Post body to a temp file and use NSURLSession's file upload API instead. But above is more appropriate if I can make it work.
Question: Can anyone guess what could be possible reason for the upload getting failed?
Sample Code: I have uploaded the iOS Sample Code + PHP Server Code to drop box. Here is the CODE
Thanks!
You can't upload streamed tasks using Background Configuration. I successfully upload data only in two cases:
Download task with data stored in request body.
Upload task from file. In that case you will not receive response body.
How to get metadata with include_media_info=true via dropbox core api sdk for iOS?
The official Dropbox iOS Core SDK doesn't currently support include_media_info yet, but it is open source so you can modify it to support it. For example, the SDK uses this method to call the HTTP API:
- (void)loadMetadata:(NSString*)path withParams:(NSDictionary *)params
The documentation for the HTTP endpoint itself can be found here.
I haven't implemented and tested this, but at a glance it seems you'd have to implemented a new metadata method that sets include_media_info in the params that it passes to the above method, or just always sets include_media_info if you know your app always needs it. You'd probably also have to update DBMetadata to returned the media info.
*Background:*I have a "document repository" kind-of app.The iOS app calls a WCF service to download the document as well as to get its metadata(document name,document size,etc).There is also a .Net client used for uploading the documents.When I upload a document,I save it in the "AppDomain.CurrentDomain.BaseDirectory" by creating a separate folder for each document.So,effectively,the document is stored at "C:\inetpub\wwwroot\Foo\bar\document.doc".
*The Problem:*when the iOS app tries to download a document,it returns error 500 "Could not find a part of the path 'C:\inetpub\wwwroot\Foo\bar\document.doc'" However,it returns the metadata for the document(document name,document size,document location,etc.) correctly.
What should I do the make the app download the document?
The error 500 was sending back from the server. So the problem is on server side. Are you sure that the path is correct? The uploaded document is on that directory?