thephpleague / csv

CSV data manipulation made easy in PHP

Home Page:https://csv.thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read from imported file ?

brandonbeschta opened this issue · comments

Q A
Version 7.2.0

Question

The Reader's createFromPath function expects a filepath but if I am trying to read an imported file I do not have a path. Wondering how do I read from a imported file (input of type 'file') Do I use createFromString instead?

Checks before submitting

  • [x ] Be sure that there isn't already an issue about this. See: Issues list
  • [ x] Be sure that there isn't already a pull request about this. See: Pull requests
  • [ x] I have read, search and not found the information on the documentation website.
  • [ x] I have read, search and not found the information on PHP related forums and/or websites.
  • [x ] This issue is about 1 question around the package with no business or domain specific logic related to a specific situation.
  • [ x] The question has a descriptive title. For example: "Can I use the library with compressed CSV documents ?".

@brandonbeschta thanks for using the library. What do you mean by import file can't you just use createFromString ?

I have a simple form that uses a input element with the type 'file' and would like to read it's contents. However on second thought yes I could just create a reader from the file contents. Thank you !