Fractaliste
Fractaliste

Reputation: 5957

How to get the path of a file create with tmpfile()

I just create a temp file with tmpfile in order to put into it a file I get from a remote FTP server.

I need to pass to an API the URL to this file, but tmpfile return a resource... How can I retrieve its path?

Upvotes: 0

Views: 1077

Answers (1)

phazei
phazei

Reputation: 5438

Actually, stream_get_meta_data($file)['uri'] should contain the path.

Upvotes: 1

Related Questions