Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

?
Lv 6

PHP script could not find file download?

Hello, I'm new to PHP so sorry if this seems rather basic but after downloading the script codes from this website: http://www.webvamp.co.uk/blog/coding/creating-one-...

I am now at the stage where I am told "We couldn't find the file to download."

I have tried specifying the exact URL of the download folder but still not luck.

The code is currently set to:

$strDownloadFolder = "/downloads/";

So, does this download directory mean "example.com/downloads/" is the directory where the download file should be hosted if index.php is in "example.com"'s root directory?

Sorry if I don't make much sense.

Thanks,

TMX boxburn

Update:

@Just Call Me AJ the "../downloads" worked perfectly, thank you so much! Hopefully as I get more used to web coding I'll become more aware of this kind of thing. I'll vote you best answer later when the option is available.

Thanks yet again.

2 Answers

Relevance
  • 8 years ago
    Favourite answer

    yes you are correct.

    Try changing the folder to "../downloads/" and see if that works. If not try it without the final /

    That's all i can think of.

  • ?
    Lv 6
    8 years ago

    check that the script is not appending and prepending the forward slashes.

Still have questions? Get answers by asking now.