Jump to content


Photo

[PHP] Directory property not found


  • Please log in to reply
5 replies to this topic

#1 Sc0tTy

Sc0tTy
  • Members
  • 4 posts

Posted 01 March 2008 - 09:52 AM

Hi,

First : I've been looking for a dll / class for FXP transfers for ages and finally found SmartFTP DLL 2 days ago. I was really amazed. And finally got to work today after trying to figure out the .chm wich is included ( bit hard to figure it out ).

I've been trying to understand the library by trying out the example for php first. http://www.smartftp....dDirectory.phps
But i keep getting an error :

Caught exception: Unable to lookup `Directory': Unknown name.

The code is exactly the same as the example and the code logs in and sends list command perfectly :

[20080301 09:38:47] TYPE I
[20080301 09:38:47] 200 Type set to I
[20080301 09:38:47] PASV
[20080301 09:38:47] 227 Entering Passive Mode (XXXXXXXXXXXX)
[20080301 09:38:47] Opening data connection to XXXXXX Port: 4912
[20080301 09:38:47] LIST
[20080301 09:38:47] 150 Opening ASCII mode data connection for file list
[20080301 09:38:47] 4982 bytes transferred. (23,9 KB/s) (203 ms)
[20080301 09:38:47] 226 Transfer complete.

Setting Listmode didnt help either

Is there something missing in the sample, or is this just a bug.
I'm using PHP 5.2.5 on Win2k3 SP2

Also i have a second question : How do i catch fired events in php ?
And a third question : Does the library support the commands being sent to the com object and not waiting for a return ? i'd like to open multiple connections and use an array to store the objects in and loop through them so i can send to multiple servers.

I'm sorry i cant purchase the software ( and post in the other support topic ), i'd really like to because its really amazing ( if i get the dir listing to work ;) ), i'm a student so i cant afford it, but i wouldnt mind contributing PHP code for the library. I'm making an entire class for it.

With kind regards,
Sc0tTy



[EDIT] : I Found in a topic for ASP code the same problem, you guys said to replace Directory with Items, this works :huh: but i was wondering what are the valid properties of this method? I'm not sure what i can extract from it. You guys should also update this in your example code and in the help .chm included.

#2 Sc0tTy

Sc0tTy
  • Members
  • 4 posts

Posted 01 March 2008 - 11:50 AM

Okay nvm my first question, i found what properties are available.

#3 mb

mb

    Developer

  • Administrators
  • 11528 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 01 March 2008 - 11:51 AM

Replace the "Directory" property with "Items".

The samples in the latest version of the FTP Library already have these problems fixed.

To see how exception handling in PHP works please take a look at the following manual:
http://www.php.net/exceptions

Regards,
Mat

#4 Sc0tTy

Sc0tTy
  • Members
  • 4 posts

Posted 01 March 2008 - 01:42 PM

Yeah, already found that.

I hope you can answer my other 2 questions.

#5 mb

mb

    Developer

  • Administrators
  • 11528 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 01 March 2008 - 07:16 PM

Hello ..

I don't know if you can catch a COM (Dispatch) event in PHP. Asynchronous calls are not recommended. Use the synchronous calls and create a new thread for each connection.

Regards,
Mat

#6 Sc0tTy

Sc0tTy
  • Members
  • 4 posts

Posted 01 March 2008 - 08:47 PM

Hello ..

I don't know if you can catch a COM (Dispatch) event in PHP. Asynchronous calls are not recommended. Use the synchronous calls and create a new thread for each connection.

Regards,
Mat


Sadly php doesnt allow multi threading, currently trying to make fxp transfers async hopefully it will work as i like. And if that doesnt work, ill just have my php thread open a new php file and hvae it output into .txt file and read the .txt file with the main thread, its what i've dont with other few thinks, works pretty good but is ugly

Atm i dont catch events i just wait for error codes to return, dont think php can do that either.

But as i said when i finish the class i wouldnt mind it made public for paying users.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users