Page 2 of 2
Posted: Sat Oct 09, 2004 9:19 am
by Bill H
I am trying to upload a file from my hard drive to a server
That's what the code I posted does.
No user is logged onto the server in my scenario.
My post included that
The $_SESSION var is the server subdirectore assigned to the logged in user, so just replace it with your desired server folder name.
is what locates the file on your lcal hard drive. If you aren't able to adapt that to a filetype other than image then you are beyond any help I can offer you.
Posted: Sat Oct 09, 2004 9:44 am
by hedge
What you're trying to do is not possible, there is no special path to locate a file on the client. php runs on the server, it can't see the file on your hard drive. You need to upload it with a form first.
Posted: Sat Oct 09, 2004 10:05 am
by Bill H
Oh my. Did you actually read the post? The lower part of the post is is an html form, complete with <input> tags, <submit> buttons and everything. The upper part of the script is the script that runs if the form has been executed.
I would point out that this script has been functioning very well, online, for several years, so I have some problem with your contention that it is impossible.
I will admit that in removing some extraneous code I inadvertantly removed the closing </form> tag, but...

Posted: Sat Oct 09, 2004 10:11 am
by hedge
Bill H wrote:Oh my. Did you actually read the post? The lower part of the post is is an html form, complete with <input> tags, <submit> buttons and everything. The upper part of the script is the script that runs if the form has been executed.
I would point out that this script has been functioning very well, online, for several years, so I have some problem with your contention that it is impossible.
I will admit that in removing some extraneous code I inadvertantly removed the closing </form> tag, but...

no BillH I wasn't saying what you were doing was impossible. He still thinks he can do this with just ftp functions, that's the part that's impossible. Sorry about that I should have quoted.
Posted: Sat Oct 09, 2004 10:20 am
by Bill H
Ah, hedge, my bad. Jumped to a conclusion.
One thing some programmers have trouble learning is that if one approach isn't working (in this case ftp functions), that a different approach (a file write) might be a solution. Seems like rather that using my approach he'd rather continue to hammer on the unsuccessful one.
Being something of an "old dog" (age 61) and programming since 1981, I don't hammer very long before I step back and consider taking a whole new approach to a problem. It makes life a whole lot easier. And the neat part is I keep learning new tricks, because I read these forums more than I post in them.

Re: Reply
Posted: Sat Oct 09, 2004 11:32 am
by twigletmac
ffcyan wrote:I appreciate the code you have posted, but that is not what I want to do. I want to do what I previously mentioned. No user is logged onto the server in my scenario. Also, my files will XML files. Therefore your code would not be appropriate. I just need to know what the syntax is for locating a local file. Thank you.
Unfortunately just because you want to do something doesn't mean it's possible

. You definitely need file uploading otherwise you will not be able to do the rest of what you want.
Mac