New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme Request: More info on insert with buffer etc. #420

Open
yogiben opened this Issue Sep 9, 2014 · 7 comments

Comments

Projects
None yet
3 participants
@yogiben
Contributor

yogiben commented Sep 9, 2014

I can't get insert to work on the server with an http url or the buffer (provided by s3).

Attachments.insert {data: data.Body,type:data.ContentType}

where data.Body is <Buffer 00 00 00 20 66 74 79 70 69 73 6f 6d 00 00...

and data.ContentType is video/mp4

gives error: DataMan constructor received data that it doesn't support

Is it possible to see an working example of this?

@aldeed

This comment has been minimized.

Show comment
Hide comment
@aldeed

aldeed Sep 9, 2014

Member

Something like:

var newFile = new FS.File();
newFile.attachData(data.Body, {type: data.ContentType});
Attachments.insert(newFile);
Member

aldeed commented Sep 9, 2014

Something like:

var newFile = new FS.File();
newFile.attachData(data.Body, {type: data.ContentType});
Attachments.insert(newFile);
@raix

This comment has been minimized.

Show comment
Hide comment
@raix

raix Sep 9, 2014

Contributor

I guess we take pr's on docs too :)

Contributor

raix commented Sep 9, 2014

I guess we take pr's on docs too :)

@yogiben

This comment has been minimized.

Show comment
Hide comment
@yogiben

yogiben Sep 11, 2014

Contributor

Thanks for the help. I ran into some separate fibers errors with the aws-sdk package I'm using.

What I'm really trying to do is insert a file based on an S3 object. I convert a video from .mov to .mp4 and detect when the conversion is finished and the file is in my bucket.

Any idea how to insert an existing S3 object into a FS.Collection?

It's probably possible to download it, then re-upload it, but maybe there's a better way. When I change the details of an existing FS.Collection doc (e.g. the key) I get an error about setting the headers.

Contributor

yogiben commented Sep 11, 2014

Thanks for the help. I ran into some separate fibers errors with the aws-sdk package I'm using.

What I'm really trying to do is insert a file based on an S3 object. I convert a video from .mov to .mp4 and detect when the conversion is finished and the file is in my bucket.

Any idea how to insert an existing S3 object into a FS.Collection?

It's probably possible to download it, then re-upload it, but maybe there's a better way. When I change the details of an existing FS.Collection doc (e.g. the key) I get an error about setting the headers.

@aldeed

This comment has been minimized.

Show comment
Hide comment
@aldeed

aldeed Sep 11, 2014

Member

There is no easy way at the moment.

Member

aldeed commented Sep 11, 2014

There is no easy way at the moment.

@yogiben

This comment has been minimized.

Show comment
Hide comment
@yogiben

yogiben Sep 11, 2014

Contributor

Thanks for your feedback.

Contributor

yogiben commented Sep 11, 2014

Thanks for your feedback.

@raix

This comment has been minimized.

Show comment
Hide comment
@raix

raix Sep 11, 2014

Contributor

Its part of sync mechanism its not implemented. I guess you could use the bare storage adapter, but we lack the list files function - should prop have it at some point.

Contributor

raix commented Sep 11, 2014

Its part of sync mechanism its not implemented. I guess you could use the bare storage adapter, but we lack the list files function - should prop have it at some point.

@yogiben

This comment has been minimized.

Show comment
Hide comment
@yogiben

yogiben Sep 11, 2014

Contributor

I was doing just that. I first tried to insert a new file with the buffer, but got a fibers error from the aws-sdk package.

Next I tried generating a signed url and inserting the file from that. Got errors on both client and server.

Will let you know if I figure it out.

Contributor

yogiben commented Sep 11, 2014

I was doing just that. I first tried to insert a new file with the buffer, but got a fibers error from the aws-sdk package.

Next I tried generating a signed url and inserting the file from that. Got errors on both client and server.

Will let you know if I figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment