Skip to main content

Background:

We have been using Printavo to manage our screen print/embroidery shop.  We have a couple of large customers for jobs completed within the last two weeks.

 

I would like to;

  1. Identify jobs for Customer A that are complete
  2. Find the URL to the actual invoice.pdf for that job
  3. Download the file to a OneDrive folder

1 and 2 are not the issue; I’m damned if I can find the easy, straightforward way to accomplish 3.  I have the URL, I have the OneDrive connected.  I need the rough equivalent of 

 

#!/bin/sh

pdfout = $(uuidgen).pdf
curl -o $pdfout $1

where $1 points to the PDF I need.

 

thanks.

Hi @spectrum 

Good question.

Help article about using files in Zaps: https://zapier.com/help/create/basics/send-files-in-zaps

Please post screenshots with how your Zaps steps are configured in order for us to have context, thanks.


Thank you.  That’s helpful.  Unfortunately now I’m seeing an error:

The Content-Range header is missing or malformed

 

The URL is of the form

https://path/to/pdf/file.pdf


Edit:

I see the problem.  That’ll open directly in my browser.  I need a way to download it, then send it to OneDrive.


@spectrum 

The file URL must be publicly accessible in order to be used in Zaps.

The image you attached could not be viewed.

Perhaps you can post screenshots again with how your Zap steps are configured.


The URL is publicly available.  Trying again with the screen shot.  

 

screen shot - upload file action

 


@spectrum 

If it’s a view link to the PDF, then that won’t work.

It needs to be a direct download link to the PDF.


Yes, that was my conclusion.  Surely there is a way to do this, short of rolling the Printavo API into my own shell script (which I would prefer not to do)?

 


@spectrum 

Often a workaround includes determining what the download File URL is and possibly dynamically generating that from the provided PDF URL.

 


As near as I can tell, the provided PDF URL *is* the file.

curl -o ~/Desktop/temp.pdf https://spectrumdesigns.printavo.com/invoice/<UUID string>.pdf

will put the PDF on my desktop.

I’ve tried this using Google Drive instead of OneDrive. No error, but I get the parent HTML instead of the actual PDF -- as if I asked for

curl -o ~/Desktop/temp.pdf https://spectrumdesigns.printavo.com/invoice/<UUID string>

(same URL without “.pdf” at the end)


Aha.  The Zapier field (Pdf) -- which should contain the download link to the actual file, and appears to in the editor -- is actually giving me the parent page.  Verified this by pasting the expected URL instead of using the field value.

How do I fix this?

 


@spectrum 

Not sure I follow.

What is a real example of the provided PDF URL vs the expected PDF URL?


What I expect:

https://spectrumdesigns.printavo.com/invoice/9068822646332425a3555e8be338fbd4.pdf

 

What I am getting:

https://spectrumdesigns.printavo.com/invoice/9068822646332425a3555e8be338fbd4

 


@spectrum

Did you try just appending .pdf to the end?

e.g. [PDF_URL].pdf


yes.  No joy.  Appending .pdf to the end still throws an error (OneDrive).

 

Here’s a screen shot -- some of the available values, including the one I want (fifth line down):

 

 


@spectrum 

Worked for me when testing.

 

OneDrive Upload File step configuration (granted it’s a static value), but if you map the correct variable for the PDF, it should work.

 

Screenshots from the uploaded file in OneDrive.

 


Huh.  That’s exactly what I’ve been doing.  It worked when I pasted the URL.  It does not work when I use the variable/PDF field.

I see now that the variable field is incorrect -- it says “www’ where it should say “spectrumdesigns”.  The “www.printavo.com” page is nothing more than an HTML redirect to the parent page:

<html><body>You are being <a href="https://spectrumdesigns.printavo.com/invoice/9068822646332425a3555e8be338fbd4">redirected</a>.</body></html>

Looks like I’ll have to use Javascript or Python to get this done.


@spectrum

Add a Zap step: Formatter > Text > Replace

Replace “https://www.” with “https://spectrumdesigns.”


Thank you.  That does it!  Thank you for your help.

 


So glad to hear you were able to get this sorted, @spectrum!  

I also wanted to summarize some of the recommendations here into one solution in case it’s easier for anyone following along!

 

OneDrive Upload File step configuration (granted it’s a static value), but if you map the correct variable for the PDF, it should work.

 

Screenshots from the uploaded file in OneDrive.

 

In this case, since the URL in question is a redirect another step was required:

Add a Zap step: Formatter > Text > Replace

Replace “https://www.” with “https://spectrumdesigns.”

Thanks again and welcome to the Community! 🎉