file_exists checks whether a file (or directory) exists in the file system. https://mydomain.com/users.csv is dynamically created when you make a https request.
What exactly are you trying to do that requires the need to call file_exists?
As long as the https stream wrapper is enabled on the server, file_get_contents will send an actual HTTPS request in the shortest code possible. If that’s not enabled you’ll have to use curl or a HTTP client (like Guzzle) to send the request.
An alternative option could be to render the CSV resource in memory, but sending a request is simpler and makes sure it’s identical to what is normally served.
I’ve actually worked around this issue by forcing the creation of a secondary CSV file via the snippet itself. So all is good.
However, I wanted to test this and you were spot on. The CSV resource was in an admin-only resource group - taking it out of this group allowed my original code and @markh code to do what they should.
I should note that the PHP file-exists function still returns false - but as @halftrainedharry said, I don’t think that’s wholly relevant.
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.