Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Added a getter for the temp file-name #215

Closed
wants to merge 1 commit into from

Conversation

Supersander
Copy link

I want to be able to access the temp file-name of an uploaded file.

The specific case where i ran into this was handling a uploaded file to be imported by PHPExcel. PHPExcel only allows loading files from a filename and not from a stream for example.
I have no interest in writing the file away when i dont have to and no interest in keeping the file after the request has been handled.
Though you could argue the is a PHPExcel problem (and I agree), I see no reason to not allow a getter for the temp-file-name.

@Ocramius
Copy link
Member

Seems wrong to me. If the limitation is in a different API, dumping to another file and then passing the path to that file further on is perfectly legit. It's inefficient, but keeps th API cleaner, especially considering that you may not have temporary paths with some http servers, whereas allowing streams in PHPExcel would solve the problem completely.

/cc @MarkBaker @PowerKiKi

@PowerKiKi
Copy link

I still don't know well enough the code base to know for sure if it would be technically possible, and desirable, to support stream. But one thing is for sure, if one of you would like to contribute to the project, then please do so in https://github.com/PHPOffice/PhpSpreadsheet, and not PHPExcel, (see why).

@Ocramius
Copy link
Member

Meanwhile, there is a separate approach to deal with this, although ugly and complicated: use a stream wrapper that exposes a file path, then use that path in PHPExcel.

I am not merging additional hacky public API here though, so I'm closing the PR. Feel free to continue discussing here, if needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants