• Resolved kindred

    (@kindred)


    The woocommerce products have been set up with the digital download defined under “Variations” and pointing to a file which exists in the server directory. Physical variations have also been set up.

    Direct access to the files in the server directory worked — I then added protection from direct access by .htaccess (deny from all) [I have tried this with both the .htaccess present and removed and get the same failure]

    the checkout process:
    go to shop/product list
    select a product
    select the “digital download” option
    add to cart
    view cart
    complete checkout

    According to woocommerce instructions, after checkout, the download link should access the file (since it is a ZIP, it should start a download). This is where the issue occurs, with the less than useful “File not found Go to shop” message.

    Apache server — mod_xsendfile Apache module is present and enabled trhough htaccess: XSendFile On
    php 7.4 (also tried with 8.0 and 8.1)
    WordPress 5.9 with Divi Theme
    WooCommerce 6.2.0
    settings: X-Accel-Redirect/X-Sendfile is set for downloadable products (have tried with Force downloads as well)
    Allow using redirect mode (insecure) as a last resort is checked

    Using redirect only (insecure) DOES complete the download, but this is not appropriate or useable for the product on the live site.

    The searches I have done of this error indicated that XSendFile needs to be active (done). The other search results reported the same issue, but I could not find any resolution to thier issues in the report threads. Several times, a report thread was referenced as “having the answer” — but whatever that answer was appears to have been deleted, since the only content visible for that thread was the initial question.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter kindred

    (@kindred)

    Update:

    2 things changed…
    1- I uploaded the file to be used directly through the WordPress interface, therefor using the woocommerce directory from the settings.
    2- the test files this time were MUCH smaller.

    Is the problem related to the directory or the size of the files?

    If it’s a file size issue, this means that woocommerce can not work for my implementation. 🙁

    • This reply was modified 4 years, 4 months ago by kindred.
    Mirko P.

    (@rainfallnixfig)

    Hi @kindred,

    X-Accel-Redirect/X-Sendfile – file download method is handled by the server. This method requires the X-Accel-Redirect/X-Sendfile module to be installed and enabled on the server which you have confirmed.

    As a first step, I would reach out to the host and check if this module is working correctly. Your host’s support should also be able to check the server logs for any indication of why the download is not starting.

    We have a digital/downloadable product handling guide that can be useful for verifying the correct configuration:

    https://woocommerce.com/document/digital-downloadable-product-handling/

    As per the maximum file size that can be used read here:

    https://woocommerce.com/document/digital-downloadable-product-handling/#what-is-the-maximum-file-size-that-can-be-used

    Thanks.

    Thread Starter kindred

    (@kindred)

    Hello, and thanks for the response.

    I have read the guide and applied the logic described there-in.
    I turned OFF “Unique String after the Filename” in case that was being rejected by server security rules (no effect)

    I have talked to the host, and they attempted to debug the issue without any resolution. (This is a good host who has helped me in many cases where other hosts would have said “not our problem, talk to the developer of the script”.)
    Looking at the server logs, there was no useful information from the failures. The Server did not generate any error, but the SCRIPT returned “file not found”.

    Failed file: 1.3GB ZIP
    Successful file: 200KB ZIP

    So, the question I have (and my host confirms) is — Why would the script generate a “file not found” message with the large file? The file is definitely present. WordPress itself can see the file (present in the media manager)
    The large file is in a separate directory, so as to keep the commercial stuff separate from the rest.

    Is there a limitation on where the file can be located?
    (e.g. does it have to be in the woocommerce_uploads/yyyy/mm/dd directory structure that woocommerce defaults to?)

    Mirko P.

    (@rainfallnixfig)

    Hi @kindred,

    Apologies for the delayed response.

    Is there a limitation on where the file can be located?
    (e.g. does it have to be in the woocommerce_uploads/yyyy/mm/dd directory structure that woocommerce defaults to?)

    No, you can also allocate files in cloud storage. WooCommerce only needs an external URL that points to your digital download file. If it is a valid external download URL, then WooCommerce works perfectly. Please review the Digital/Downloadable Product Handling guide and FAQ here:

    https://woocommerce.com/document/digital-downloadable-product-handling/#can-i-use-cloud-storage-to-store-my-files-and-downloads

    As I commented earlier when a file is “Not found” and your download method is “Force download” it’s usually an issue with the server not with WooCommerce. In this case, you can try another host or use an external cloud service.

    We have an Amazon S3 Storage extension on the Marketplace which enables you to serve digital products through your Amazon AWS S3 service. If you’re interested you’ll find the extension here: https://woocommerce.com/products/amazon-s3-storage/.

    Hope this helps.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    We’ve not heard back from you in a while so I’ll go ahead and mark this thread as resolved. Hopefully, you were able to find a solution to this issue.

    If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Unable to download digital product (file not found)’ is closed to new replies.