01-20-2019 11:27 AM
Hello,
Just in the process of trying to get our PHP script to download the file exchange file automatically by supplying our token and the reference/job id but keep getting the error "The file server is currently unavailable. Please try again after some time."
It seems quite a common after looking around and I'm wondering if anyone has any idea what causes it and a way around it? Or if there is another way our PHP script can automatically download the orders that are paid for and waiting to be shipped?
Any help is greatly appreciated.
Thanks.
01-20-2019 12:35 PM - edited 01-20-2019 12:37 PM
Problem is that you must know the ref # of the download request. There is no way that I know of to automatically initiate a download request, except as a scheduled process. Since the scheduled process has not run yet, no ref # is assigned to the download report.
If you could initiate a download, the ref # would be returned to you. This does happen if you upload a FileExchange CSV file. If you use Libcurl, eBay returns a cookie, but if you use the command line form of curl a text file is returned that contains the reference number (the cookie also has this info, if you know how to decode it). You can then use that ref # to check for and return the upload results file. This is the purpose of the programmatic instructions in the FileExchange Advanced Instructions.
Now you could, view the download report screen, obtain the ref #, and then download that report programmatically. But if you look at the page (download report page), why not just download it then.
Since eBay sends you an email when a report is available, and you have a method of reading your email programmatically, then you could extract the reference number and then programmatically download it.
Re-post if you need an explanation of the download process. I download my upload results daily.
01-20-2019 03:25 PM - edited 01-20-2019 03:28 PM
I wrote the script below, that should download a 'download request'. I got the same result as you have -'The file server is currently unavailable...'.
The script should work, and does, from the upload results page. But it shows the error when downloading from the 'Completed download page'.
I would suggest that you call eBay...This is from the eBay Advanced Apps team...
Phone Support (US - 8 AM - 6 PM MST): **To call us, click on the Help & Contact link found at the top of most eBay pages. Click on the Contact Us button at the bottom of the page. Select ‘Selling’ -> ‘Getting Started’ -> ‘Selling Tools’ for issues or concerns related to eBay listing tools that my team can assist you with. Now scroll to the bottom and click Call Us. Ask the customer support agent to transfer you to the Advanced Apps team.
My script...
<?php // jan 20 2018 // // process execution - php download.php 9999999999 <- argv[1] would be the job no of the download file // // define function to download job # from FileExchange // function download_file($jobNo,$token) { $downLoad=false; global $downloadFileName; $cmd = 'curl -k -o '.$downloadFileName.' --data-urlencode "token='.$token.'" --data "jobId='.$jobNo.'" https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeProgrammaticDownload 2>&1'; $findMe='requested file was not found'; while (!$downLoad) { exec($cmd,$resultsArray); $workString = file_get_contents($downloadFileName); $pos = strpos($workString,$findMe); if ($pos==4) writeLog ('File not ready. Waiting 2 min.'); sleep (120); } else { $downLoad=true; } unset($resultsArray); } return; } // lets get started here // check for job no as arg 1 (arg[0] will be the script name) if(!$argc[1]>1) { echo "No Job no supplied.".PHP_EOL; exit; } // set up output file name $jobNo=$argv[1]; // lets get started // set up output file names $downloadFileName='FileExchange_Response_'.$jobNo.'.csv'; // // get eBay token into string $token $token=file_get_contents('token.txt'); // get results file $resultsArray=download_file($jobNo,$token); exit;
01-21-2019 04:22 AM
@Anonymous
Question. Does the token and the programmatic upload/download options, only work for user csv files? Or are they supposed to also work with the FileExchange report options?
01-21-2019 04:26 AM
Note that the script above is missing a "{", after 'if ($pos==4)'.
01-21-2019 08:32 AM
After a bit more digging and reading some of your previous posts on the subject I have managed to get my php script to read the emails received from the hourly scheduled report, grab the reference number and download the file from it.
So I have somewhat been able to get what I wanted working where it automatically grabs the pending dispatch orders from ebay, the only issue is the hourly schedule on the file exchange doesn't get the very latest orders. it seems to be around half an hour behind.
It's a shame there doesn't seem to be a way to initiate a download request programmatically so we could supply a start and end time period like we can when done manually.
Although at least the main download part is working now.
Thanks for the help!
01-21-2019 11:09 PM
"'The file server is currently unavailable...'."
This is the same error message I receive (within a report file) when attempting to download a report intended for another member, indicating it is a permission issue.
Welcome to the Seller Tools board! You can chat with other members about seller tools and best practices in using them.
Tools related questions? Learn more about:
Videos: