Welcome Guest, Not a member yet? Register   Sign In
Help with FTP library local path
#1

[eluser]marcogmonteiro[/eluser]
Hi there,
here's my problem:

I'm building something like a filemanager. But the Filemaganer is in one place and the files will be stored in another.

I've been reading the documentation on how to accomplish this. And I'm using the FTP Class...
List files and folders from external ftp = Done
my problem is on the uploading part.

The documentation says:
Code:
$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);
but how can I get the local path since php is a server side language?

My 1st thought was to try the $_FILES array and check for that path but no luck. That only gives me the tmp path and if I try to upload that it returns an error:

An Error Was Encountered
Unable to upload the specified file. Please check your path.

is there a solution for this?

thanks in advance...
#2

[eluser]toopay[/eluser]
[quote author="cancerman" date="1308163088"]
but how can I get the local path since php is a server side language?
[/quote]
Whats that really mean? Off course you can. Otherwise, some "client-side" languange (or semantic languange) like javascript, is can't retrieve full path of a file (or the real path to the file will be shown only if the page that contains the control is added to the trusted sites collection of the browser).

For your task, try pathinfo() function.
#3

[eluser]marcogmonteiro[/eluser]
I'll check it later today.

Thanks mate!
#4

[eluser]marcogmonteiro[/eluser]
I have another problem now. I need to list all the files on a specific folder. No problem there. But I need to show the files in a specific order. More recent to older file. What is the default order?




Theme © iAndrew 2016 - Forum software by © MyBB