Files upload not working on IOS.
IDCOLL opened this issue · 23 comments
- Meteor 1.3.5.1
- Meteor-Files v1.8.0 , added via Meteor Add ostrio:files
- Server Side Issue
I have Meteor-Files uploading images via my Webapp to Dropbox. The solution seems to work on my Windows Laptop (Chrome, Mozilla) browsers. On mobile devices that is Android based it uploads to Dropbox.
It will however not upload from my iphone (Guessing IOS related?). Is there a know issue for IOS devices. When I go to the files.veliov.com site and I try to upload from the same IOS device it will also not start.
The server log gets stuck on the following line:
---[Upload] [DDP] Got #1/1 chunks, dst: image.jpg
My code for uploading,**client side**:
var uploadInstance = Images.insert({
file: file,
streams: 'dynamic',
chunkSize: 'dynamic'
}, false);
uploadInstance.on('start', function() {
this.currentUploadvar = 1;
console.log(this.currentUploadvar);
});
uploadInstance.on('end', function(error, fileObj) {
if (error) {
alert('Error during upload: ' + error.reason);
} else {
alert('File "' + fileObj.name + '" successfully uploaded');
}
// console.log('Upload Ended');
// this.currentUpload.set(false);
this.currentUploadvar = 0;
});
uploadInstance.start();
Server side code,
Basically the same as the Dropbox upload tutorial.
Any assistance would be greatly appreciated.
Hello @IDCOLL
- Haven't tested this package on such old Meteor, is there a reason why you're not updating?
- Try to play with
streams
andchunkSize
, start with:{streams: 1, chunkSize: 102400}
Thank you for the quick response,
- I haven
t upgraded due to some core packages that I use still doesn
t easily work since Meteor 1.4. But I know I have to... - I will play around with the streams a bit.
Just 1 question, when I go to your demo site, https://files.veliov.com/ i can also not upload fotos from my iphone. Should your demo site work with all devices?
There is old version of the package, where is DDP on iPhone was broken. Don't have time to update this demo.
Click on "gear" icon and select "HTTP" as uploading transport.
You may also set transport to HTTP in your code.
Okay great. the upload on your demo site works when switching to HTTP.
Now to try and get it working on my app...
Hello @IDCOLL ,
Any news on your end? Is it solved?
Hello @IDCOLL ,
Sure see transport
in the .insert()
method docs.
FilesCollection#insert({
file: e.currentTarget.files[0],
transport: 'http'
});
Awesome!
Please, support this project by:
- Star on GitHub
- Star on Atmosphere
- Check other packages we have made
With ostrio:files (Meteor-Files) 1.8.0 we also had this problem, that iOS devices sometimes could not upload at all, sometimes simply the progressbar stuck at 0%, then after "some time" (>10 Secs) the Upload was nevertheless successfully done.
We are on Meteor 1.5.1.
For us the solution was streams: 1
inside FilesCollection.insert(), so we still use DDP.
see: 4minitz/4minitz@ff8f0e2
Hi @dr-dimitru,
I updated to Meteor 1.5, upgrade to v1.8.1 but my iphone issue is still present.
Exactly the same result as previously.
Current Dev setup:
Meteor 1.5.1
ostrio:files (Meteor-Files) 1.8.1
OS Linux 16.04
I have stopped all apple uploads on my app, and moved back to DDP uploads. the HTTP uploads failed to many times.
Below are the logs for my attempt to upload.
[......][FilesCollection] [find(undefined, undefined)]
[.......][FilesCollection] [find(undefined, undefined)]
[.......][FilesCollection] [Upload] [DDP] Got #1/3 chunks, dst: image.jpg
[.......][FilesCollection] [find(undefined, undefined)]
[.......][FilesCollection] [find(undefined, undefined)]
[........][FilesCollection] [find(undefined, undefined)]
[..........][FilesCollection] [Upload] [DDP] Got #1/3 chunks, dst: image.jpg
[..........][FilesCollection] [Upload] [DDP] Got #1/3 chunks, dst: image.jpg
[........][FilesCollection] [find(undefined, undefined)]
What is interesting, this loop that the server gets stuck on, crashes the server.
Tried streams : 1 as well, still no success.
Hello @IDCOLL ,
- Was it working before the update? If yes, - what Meteor and Meteor-Files versions you were on?
- Any client errors?
- With what exception server is crashing?
Hi,
- As mentioned at the beginning of this issue #458, I experienced this issue using
Meteor 1.3.5.1
Meteor-Files v1.6.1 , added via Meteor Add ostrio:files //Wrongly quoted 1.8.0 on my initial quote
I then moved to use http tranfer method, which worked for the apple devices but it made uploads difficult for other devices.
-
The client doesn
t receive an error, the upload just doesn
t progress at all. -
The server doesn`t crash with an error, it just keeps on going through the "[FilesCollection] [Upload] [DDP] Got #1/3 chunks, dst: image.jpg" loop until the server runs out of CPU capacity and then restarts.
v1.6.1
is a way too old. I can not guarantee it should work. Many bugs was fixed since its release.
Are you able to upgrade?
I understand. That is why I upgraded to v1.8.1
@IDCOLL is issue appears on development and prod, or only prod?
@IDCOLL and Client log you've posted looks like, connection was interrupted, then established again, and upload resumed with not sent chunk, which is #1
Well actually it's Server logs.... anyways could you please post fresh Server and Client debug logs?
Issue is not solved... the big problem right now is that if an image is selected and it is on iCloud... it's almost like the file changes. I keep getting a DDP -1/28 in the uploader log.
Nothing happens.
Try the file again, it uploads as expected.
Trying some client side hacks now to solve...
[FilesCollection] [Upload] [DDP Start Method] Got #-1/10 chunks, dst: D5FEF0CA-D322-460C-8795-AF5CA11B914D.jpeg
The result on server is the file is a 0kb text file?
In order to get this working on iOS I've had to wrap my uploader in a timeout:
setTimeout(function(){ upload.start(); },2000);
Two seconds seems to work.
I feel like the iOS app for file management is slow to release the file. You select it, and it does some sort of extra process -- yet your application is sent the signal of file received. As shown above this is not the case, it is 0kb and a text file -- it's blank.
Perhaps more research can go in to the iOS photos API or something to discover the true source of this bug and ACTUALLY resolve it. Maybe building some more code to say "Wait for actual iOS photo to enter the FILE system.
We could examine the Cloudinary uploader system, I have another system running that for media and it's working perfectly on iOS.
@dr-dimitru Just a friendly tag to come and revisit an interesting find :)
Hello @AndyNormore ,
Thank you for reporting about this, is this issue still a case?
If so, have you got any insights from Cloudinary uploader?
//cc @jankapunkt