Jump to content

Archived

This topic is now archived and is closed to further replies.

SharkBait

Location of file to be read from

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
[quote author=SharkBait link=topic=105381.msg420897#msg420897 date=1156358655]
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 :)
[/quote]
Everything php does is serverside... Where does the file come from, a client? You're not making much sense to me.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.