Jump to content


Photo

Location of file to be read from


  • Please log in to reply
2 replies to this topic

#1 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 23 August 2006 - 06:44 PM

Hi,

  PHP can only read files server side correct?


I am creating a mini-script where I can have PHP read from a file (a CSV) and parse through it.

I guess I will need to upload the file to the server, read the file, do my thing and delete the file after succuessful completion.

Right now I move the file manually, and then just manually change the filename/path in the script to have it read.

There is no other way to do this is there? I do have to put the file on the server correct?

Just making sure that this is the way I will have to do it :)

#2 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 23 August 2006 - 06:54 PM

Hi,

  PHP can only read files server side correct?


I am creating a mini-script where I can have PHP read from a file (a CSV) and parse through it.

I guess I will need to upload the file to the server, read the file, do my thing and delete the file after succuessful completion.

Right now I move the file manually, and then just manually change the filename/path in the script to have it read.

There is no other way to do this is there? I do have to put the file on the server correct?

Just making sure that this is the way I will have to do it :)

Everything php does is serverside... Where does the file come from, a client? You're not making much sense to me.

#3 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 23 August 2006 - 06:56 PM

Short answer, yes. PHP is a server side language. Of course you can take a diferent approach, in which you can copy/paste the contents into a textarea and parse it, sort it, and do what you need to with it (Even spit out a CSV file if you like). But if you need to go through the effort of doing that, simply uploading it may take just as much effort, and will likely be simpler to approach. What exactly do you need to do with the data? I guess your goal isn't clear and I'm a bit puzzled as to what you're trying to do.
PHP Ninja




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users