NetTalk Central

Author Topic: File Download Question  (Read 3269 times)

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
File Download Question
« on: November 21, 2014, 05:23:26 AM »
Hi,

I have a NetWebPage that is being called from an outside source to download a user specific file. If the file was not created for them how can I return back to them a message like "File not available, try later"?

Ashley

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: File Download Question
« Reply #1 on: November 25, 2014, 11:29:31 PM »
Hi Ashley,

in the page you can do a

p_web.SendError('503','File Not yet available','the file is not available yet, try again later')

and then do a return.

the exact code to use is somewhat up to you - there's no HTML reply code that matches this situation exactly - but there's a discussion on codes here;

http://stackoverflow.com/questions/9794696/best-http-status-code-in-rest-api-for-not-ready-yet-try-again-later

Of course, you could just returna page that says "File is not yet ready".

cheers
Bruce


astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: File Download Question
« Reply #2 on: December 03, 2014, 09:46:59 AM »
Thanks Bruce