Comments
-
Thanks Steve, I too suggested a recursive function solution but my team favored the threading/semaphore route.
-
Thanks for all your help. I got it working. In case anyone needs sample code, here is how I handle uploading a file by appending 5MB chunks.... let chunkLength:UInt64 = 1024 * 1024 * 5 //in MB let fileLength:UInt64 = UInt64(data.length)//Double(data.length)/1024/1024 //in MB print("FILE LENGTH: \(fileLength)") print("CHUNK…
-
ok, so now i'm playing around with waiting for each append to return before the next one is called and I'm getting successful (void) returns.
-
Here's my latest code. It seems like the append operations aren't being processed in the order they are called, so I'll get incorrect offset errors. For example, I had seven append calls, two succeeded, five failed. let chunkLength:UInt64 = 1024 * 1024 * 5 //in MB let fileLength:UInt64 =…
-
Can I only call another append when the previous append has returned? Currently, I'm calling all of them in a while loop and not waiting on a return.
-
Before I share my latest code, let me make sure I understand the offset. It says... <EM>offset</EM> The amount of data that has been uploaded so far. We use this to make sure upload data isn’t lost or duplicated in the event of a network error. Does this mean the amount of data uploaded in previous call(s)? (i.e., does not…
-
I'm getting successful append results...but the uploadSessionFinish keeps throwing an HTTPError. Do I need to do any memory management with how many appends I can do during a session? client.files.uploadSessionAppend(sessionId: result.sessionId, offset: startPosition, body: tempData).response { reponse, error in if let…
-
Thanks, so now i'm chunking up my file and upload is successful for files 200MB or less but now I get a memory warnings for anything bigger. Am I suppose to send the first chunk with sessionStart, and the last chunk with sessionFinish? Or should the start and finish have empty body data and append all the chunks through…
-
Thanks for working with me on this, but my HTTPError comes back as... HTTPError[nil]: nil: Optional(") Here's my code.... //trying to upload a 33MB file in 5MB chunks let data:NSData = NSFileManager.defaultManager().contentsAtPath(path)! let chunkLength:UInt64 = 1024 * 1024 * 5 //in MB let fileLength:UInt64 =…
-
cool, thanks, i'll give it a shot. I was getting an HTTP error.
-
thanks, so no cancel for downloads or uploads?
-
Thanks, I'm gonna try a bigger video. A friend suggested that it might be fully downloading that fast and what I'm seeing in the console is queued data.
-
i decided to call a completionHandler after printing the NSData to console. That seems to introduce the delay of fully downloading the file before the completionHandler is called.
-
I'm actually getting the response back immediately, then the data from the video comes streaming across. There's no delay. In other words, it's giving me a response back when the file isn't fully downloaded. I'm not actually trying to play the video just yet. I'm trying to notify the user when it's fully downloaded, but…
-
Thanks but when I execute these print statements inside the block, it takes about 3-5 seconds to print the NSData to the console, so I can't play the video back until it finishes. print("*** Download file ***") let data = NSData(contentsOfURL: url) print("Downloaded file data: \(data)")