The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Button code for self hosted downloads?

beebee Member
in Bugs & Feature Requests edited September 2010
Hello! I've finally got my scripts working for hosting my own downloadables, and the php test (test_xml_datafeed.0.7.php) on your site confirmed that my datafeed was working...

However, I can't get a test transaction to process properly. It goes all the way through as expected, but doesn't e-mail the customer. Instead, it sends me an error message along the lines of "Your XML Datafeed processor for Perfect Subliminal failed to process a recent transaction".

How do I make my buttons link to the products I have listed on my products.csv (i.e. in my mySQL database)? Do I use a category? I've tried putting the name and code values exactly the same as in my csv file, but it still doesn't work.

Please, someone help! I'm nearly there and very much looking forward to launching my store with FoxyCart :)

By the way, I'm getting the receipt e-mails ok when I do a test transaction, just no download link generated. Error log states "Datafeed Returned: Error: Invalid product (trans: xxxxxx, prod: , price: 19.99) Error: No link was generated for transaction #xxxxxx).
  • lukeluke FoxyCart Team
    Hey bee. Have you had any luck contacting the developer of that integration? The questions you're asking about are hard for us to help with since we don't have access to your server and we didn't write the original script. If you want, we can recommend some developers for hire that might be able to help you out. The error message should hopefully give you some clues as to what's going on. Have you looked through the code that generates that error message? It looks like whatever value was expected after "prod: " is missing. Is that a product code? Are you passing in a "code" value on your add to cart link?
  • beebee Member
    edited September 2010
    I've almost got everything working! Although at first, when I download my test files (no matter what format - mp3's, zips etc), the browser thought the file was a jpg.

    I fixed that by adding:
    case "zip": header("Content-type: application/zip"); to the download.php file

    However, the file won't decompress after downloading. PLEASE HELP... WHY WON'T MY ZIPS DECOMPRESS? this really shouldn't be as hard as it is! Surely you guys can help; this is basic stuff!

    It's a good thing your cart looks so "foxy" or I'd be going elsewhere by now ;)

    Thanks again x

    PS here's a snippet of the end of the code from the download.php (including my zip amendment). Does it look ok? And is there anything obvious why a zip won't open after download?

    case "pdf":
    header("Content-type: application/pdf"); // add here more headers for diff. extensions
    case "zip": header("Content-type: application/zip");
    header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a download
    header('Content-Type: application/x-download');
    header("Content-Disposition: attachment; filename=\"$file_name\"");
    header("Pragma: cache");
    header("Content-length: $fsize");
    header("Cache-control: private"); //use this to open files directly
    while(!feof($fd)) {
    $buffer = fread($fd, 2048);
    print $buffer;
    fclose ($fd);

  • fc_adamfc_adam FoxyCart Team
    @bee, I think you may have the wrong content-type for zips. Take a look at this thread:
  • Of course, you are right about the content and I've amended the script accordingly... The corruption turned out to be a server/domain/IPaddress-wotsit-thingy error, and after switching servers everything is now working just fine!!! OMG - this means I can finally have an online store, hosting my own downloads with FoxyCart :)

    Question: Is there a limit to the size of a self hosted file using FoxyCart?
  • brettbrett FoxyCart Team
    Question: Is there a limit to the size of a self hosted file using FoxyCart?
    Probably depends on your server and configuration, as well as the version of the self-hosted script you're using. The first version stored files as blob fields in the database, which may have more limitations depending on your host. The best bet would be to always test when you add a new file, just to make sure.
Sign In or Register to comment.