#alex-from-fuxam_code

1 messages ¡ Page 1 of 1 (latest)

ruby obsidianBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1299359156133953606

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

wanton hearth
#

The invoice.invoice_pdf link isn't a direct link to the pdf that's why

#

It's a link to a webpage where you can download the pdf

#

There's not a direct link to download the pdf available

opaque grail
#

how could i programmatically download the invoice pdf?

wanton hearth
#

We don't provide a way to do this currently

#

Oh actually hold on I'm mixing up the link we provide on the dashboard and invoice_pdf

#

invoice_pdf should directly download the file, but not sure offhand how to do this programatically

#

Let me see if it's possible actually

opaque grail
#

Thank you!

#

A client of ours is requesting this, so it would be very helpful

wanton hearth
#

I recommend just sharing the link in invoice_pdf with them

#

That will be a direct link to download

#

Any reason you need to download the file to your server first?

opaque grail
#

We have a feature where clients can download files and save them to their own cloud service on our platform. We are dealing with large educational organizations that want to avoid saving files on their computer as much as possible, since this clutters their computer. This is why we offer them their own drive like a google drive for example.

#

In order to upload it therre, we first have to have the actual file. If we dont have this, they have to download it to their PC, upload it again to our drive and then delete the file and this would cause some inconvenience for them

wanton hearth
#

Got it ok

#

Ok I was able to successfully request the file and write it locally in python at least

#

Are you trying to do this server-side?

opaque grail
#

This is client-side

wanton hearth
#

Ah ok I assume that's the issue

#

What's the error message?

opaque grail
#

With no-cors, theres no error message. O

#

I tried without and got the same

wanton hearth
#

Ok 302 code

#

Which is a redirect

#

Yeah the link isn't a direct link

#

Is doing this server-side an option?

opaque grail
#

Yes but if at all possible we would like to do this client-side.

#

Are we sure its gonna work server-side?

#

Wouldn't that also redirect?

wanton hearth
#

I was able to do it server-side in python just now

#

I'm not a node guy, so I tested in python

opaque grail
#

I'll try this out. Can we keep the thread open while I do that?

wanton hearth
#

Sure

brisk bough
#

@opaque grail checking in to see if you're all set here?

opaque grail
#

Hi, had a short delay because of a production bug, i picked this back up 5 mins ago