title: Prestashop, wget invoice
body: <p>I'm trying to download invoice with bash script(wget), because I need to save invoices to my server automatically when order is made. I looked for other solutions but that didnt work, like downloading invoice with changing  tcpdf.php.The post was up here: <a href="https://www.prestashop.com/forums/topic/465729-automatically-generate-invoices-in-a-folder/" rel="nofollow noreferrer">https://www.prestashop.com/forums/topic/465729-automatically-generate-invoices-in-a-folder/</a></p>
  
  <p>So first I need to login to prestashop adminpage I suppose. Logging in got me confused, because how do I know when I'm logged in? This what I did: </p>
  
  <pre><code>wget --save-cookies cookies.txt --keep-session-cookies --post-data 'email=example@gmail.com&amp;passwd=example' http://www.example.ee/admin/index.php?controller=AdminLogin&amp;token=5a01dc4e606baa6c26e95ddea91d3d14
  </code></pre>
  
  <p>After saving my cookie, I tried to download the invoice by:</p>
  
  <pre><code>wget --load-cookies cookies.txt -e robots=off -A pdf -r -l1 http://www.example.ee/admin/index.php?controller=AdminPdf&amp;token=35b276c05aa6r5eb516437a8d534eb64&amp;submitAction=generateInvoicePDF&amp;id_order=3197
  </code></pre>
  
  <p>But I get an error: <code>Deleting, www.example.ee/admin/index.php?controller=AdminPdf, since it should be rejected</code></p>
  
  <p>I think It's because I'm still not logged in?</p>
  
  <p>It would be very nice that if it's possible without wget.</p>
  
  <p>PS changed my website to example,etc</p>