Jump to content

Location of file to be read from


SharkBait

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 :)
Link to comment
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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.