cancel
Showing results for 
Search instead for 
Did you mean: 

Check URL for 404 Prior to Download

SOLVED
stapuff
Comet

Check URL for 404 Prior to Download

Is there a way to check a URL for 404 errors prior to downloading?

 

I run a workflow that downloads PDF's from a URL and if it doesn't exist I get a 404 error and a blank pdf.

Is there a way to not download if 404 is returned?

 

Thanks,

 

Puff

5 REPLIES 5
stapuff
Comet

Check URL for 404 Prior to Download

Is there a way to check a URL for 404 errors prior to downloading?

 

I run a workflow that downloads PDF's from a URL and if it doesn't exist I get a 404 error and a blank pdf.

Is there a way to not download if 404 is returned?

 

Thanks,

 

Puff

Jonathan-Sherman
15 - Aurora

Re: Check URL for 404 Prior to Download

Hi @stapuff,

 

Yes, we could use the message/test tools in combination with a block until done tool to perform the check. If status != 404 then continue with the rest of the workflow. If it is then error out and stop the workflow.

 

Do you have a URL we could use to mock up an example?

 

Regards,

Jonathan

Re: Check URL for 404 Prior to Download

@Jonathan-Sherman 

 

I appreciate the response back.

 

Quite often I have a list of URL's I am running against 10,20,100.

Actually a single URL with a different parameter for each.

 

The process downloads Invoices from an internal url with the invoice # appended to the backend of the URL and wouldn't want the workflow to stop or error out. Just not download it.

 

Possibly use a message tool to turn off and on a container in a batch macro?

I have never used a message tool before.

 

Thanks,

 

Puff

Re: Check URL for 404 Prior to Download

@Jonathan-Sherman 

 

I found the solution I was looking for in the following post.

 

https://community.alteryx.com/t5/Alteryx-Designer/Pre-check-if-website-is-valid-before-using-the-dow...

 

I appreciate the time you spent on responding and suggestion.

 

Thanks,

 

Puff

jarrod
ACE Emeritus

Re: Check URL for 404 Prior to Download

Hi @stapuff ,

As a leader in the Alteryx Community, I have the ability to identify & mark accepted solutions on behalf of community members - and recently did so on this thread. If you have any questions or concerns with the solution(s) I selected please let me know by replying to this post.

 

i understand you found the answer in another thread, but i wanted to at least call it out in this thread to make sure anyone that came across your question was able to find what you did. Thank you for coming back to close the loop on your question.


As the original author, you also have the ability to mark replies as solutions! Going forward, I’d encourage you to identify the solution or solutions that helped you solve your problem, as it's a big help to other community members. Learn more about Accepted Solutions here.

Thank you!

vijaysuryav93
Meteor

Re: Check URL for 404 Prior to Download

Though it's too late, But just posting it for future references. 

 

I have written a python based workflow/tool, where it would validate a URL to be Valid or Not Valid, It is based on the python socket library using a method 'gethostbyname'. It would be one of the fastest solution I have ever come across. This could validate any number of records. Rough estimate to validate 1000 records would be 7 Minutes. 

 

 

Attachment
Download this attachment