Skip to content
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

No example for copyOut #41

Open
vladignatyev opened this issue May 31, 2018 · 7 comments
Open

No example for copyOut #41

vladignatyev opened this issue May 31, 2018 · 7 comments

Comments

@vladignatyev
Copy link

I have tried:

uploadfs.copyOut(ufsUrl, tmpFilename, function(e, info) { ...my handler... });

where ufsUrl is a self.apos.attachments.url(attachment) from Apostrophe related code.

But I have no output at expected tmpFilename path.

What am I doing wrong? I see lack of documentation about copyOut, but I need this method for post-processing of my images.

@starsinmypockets
Copy link
Contributor

One suggestion would be to take a look at the test/ folder which has working copyOut examples for the various storage backends.

@boutell
Copy link
Member

boutell commented Jun 1, 2018 via email

@vladignatyev
Copy link
Author

I'm trying self.apos.attachments.url(attachment, {"uploadfsPath": true}); and only difference in behaviour I get is that the returned url contains prefix of upload path (because I use Apostrophe with local backend for storing uploaded files). Anyway, copyOut doesn't run my callback handler at all :(

@vladignatyev
Copy link
Author

This difference in behaviour is from local.js, luckily it works as expected, but somehow copyFile isn't invoked or exceptions handled and omitted somewhere. Investigating...

@vladignatyev
Copy link
Author

Finally got it. I was invoking copyOut within queue (better-queue) task. What I get now is that I don't know how to get uploadfs instance from Apostrophe. Any help? Please!..

@boutell
Copy link
Member

boutell commented Jun 1, 2018 via email

@vladignatyev
Copy link
Author

@boutell Thanks for pointing it! Love you, bro, you saved my life and pocket! No need coffee today 💃
I've tried to get uploadfs settings from apo's attachments module, but newly created instance behave stranger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants