Jump to content



Photo

FTP Explorer - Updated 3-17-2010


34 replies to this topic

#1 Beege

Beege

    Universalist

  • MVPs
  • 843 posts

Posted 05 June 2009 - 06:32 PM

Update 3-17-2010
Here the latest of my FTP Explorer. Its probably going to be a while before I post anything else for this project. Even though this project has come a long way from when I started it, I don't like the direction its heading. I'm really starting to see what Valiks always taking about with global variables being bad and creating interfaces that handle different sections of the programs. Right now I have so many global vars, and anytime I want to change something it takes ten times more time updating the rest of the script then it did to write the actual change. Anyway, I got to do something because its becoming not fun anymore. And who wants to have a hobby thats not fun? :D Btw this is written to work with v3.3.6.0. Changes:
- Added Up/Down Icons for queue list. (Thanks for idea Zedna)
- Made Changes to Richedit Functions. Now more colorful.
- Each listview and richedit are automatically given focus when mouse hovers them.(going to make it optional in future)
- Created a main icon for script and back buttons.
- Rewrote main FTPNavigation fuction. Major performance increase.
- Added function that sets back button tooltip to the directory it will navigate to.

Transfer.gif Idle.gif
Attached File  FTP Explorer 3-17-10.zip   80.74K   758 downloads


Update 1-27-2010
Alright so here is the latest update for my FTP Explorer. If you would like to compile it use the scripts in the compile folder I made. Those scripts have been Obfuscated to remove a lot of unused functions. Makes a huge difference in file size. As always, please let me know if you have any kind of problems. Written to work with v3.3.4.0. Some of the new additions that I have been working on are:
- ability to abort transfers
- ability to maximize
- New right-click menu for selecting columns views (Size, Modification Date, Creation Date..)
- automatic Queue List restore. (also restores your navigation history)
- estimated finish time for file transfers
Attached File  FTP Explorer 1-27-2010.zip   71.83K   414 downloads

Update 1-10-2010
Well I have done a lot of work to this since the last one. One of the biggest features is that it now uses a second process to handle the uploading and downloading (Thanks Yashied). The second process creates its own connection which allows you to continue navigating while you have tranfers going on. Some of the other things that I have been working on for it include right-click menus, RichEdit status box, status bar, history ini to keep track of previous connections and info, history combo boxes that you can type directory's in and navigate stright to. I Still have a some more ideas to implement but thought I would post what I got to see if I could get some feedback. Any opinions, ideas or problems, please don't be shy to drop me a line :D This is written to work with v3.3.2.0.
Attached File  FTP Explorer 1-10-10.zip   19.25K   292 downloads

Initial Release
Here is another FTP Explorer program I have been working on. Its not quite finished but close. I still have a couple things to do but wanted to show. The new beta is needed to run this. Special thanks go to Prog@ndy for his Icon functions and _FTPEx udf. Please let me know about problems you experience, or recommendations. Thanks For Looking!!
Attached File  FTP_Explorer.au3   43.41K   891 downloads

Edited by Beege, 17 March 2010 - 06:52 PM.






#2 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,512 posts

Posted 05 June 2009 - 07:16 PM

bchris01, good job, but I think it would be better to make the upload/download functions in a separate process (files) and the communication between him and the GUI. In this way you get rid of the hangs in main program. I have a similar project, I wrote to clients of the company in which I work. And in my program, I separated the GUI, and the upload process in different modules. Also, it would be good idea to use InternetSetOption() function to change the timeout when the connection to the FTP-server, etc.

http://www.autoitscript.com/forum/index.php?showtopic=93916

Edited by Yashied, 05 June 2009 - 07:33 PM.


#3 Beege

Beege

    Universalist

  • MVPs
  • 843 posts

Posted 06 June 2009 - 09:47 PM

Thanks Yashied. I will look into the tips you gave me.

#4 laojikelly

laojikelly

    Seeker

  • New Members
  • 4 posts

Posted 06 June 2009 - 11:43 PM

thanks for sharing!
beautiful scripts !

#5 FinalVersion

FinalVersion

    0 ^ 1

  • Active Members
  • PipPipPipPipPipPip
  • 599 posts

Posted 07 June 2009 - 05:34 AM

Pretty sexy..

#6 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,512 posts

Posted 07 June 2009 - 07:16 AM

Pretty sexy..

?!?

#7 sc4ry

sc4ry

    Wayfarer

  • Active Members
  • Pip
  • 81 posts

Posted 07 June 2009 - 03:06 PM

can somebody link the ftp_ex.au3?

#8 ProgAndy

ProgAndy

    You need AutoItObject

  • MVPs
  • 2,508 posts

Posted 07 June 2009 - 03:10 PM

It should be included in AutoIt 3.3.1.0 Beta :D (FTPEx.au3)

Edited by ProgAndy, 07 June 2009 - 03:10 PM.

*GERMAN* Posted Image [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

#9 Ashalshaikh

Ashalshaikh

    Wayfarer

  • Active Members
  • Pip
  • 97 posts

Posted 07 June 2009 - 04:49 PM

Nice work
Thanks

#10 omegabobm

omegabobm

    Seeker

  • New Members
  • 1 posts

Posted 05 September 2009 - 12:36 AM

thank you,but it has some problems when changing dirs

#11 Beege

Beege

    Universalist

  • MVPs
  • 843 posts

Posted 05 September 2009 - 01:21 AM

thank you,but it has some problems when changing dirs


What kind of problems?

#12 davidkim

davidkim

    Adventurer

  • Active Members
  • PipPip
  • 100 posts

Posted 29 September 2009 - 05:13 AM

FTP Explorer Bug..


Func _FTPdelete()
Local $selectedftp, $i, $curftpdir, $del
$id = MsgBox(36, 'Confirm File Delete', 'Are you sure you want to delete selected files?')
If $id = 7 Then Return
$selectedftp = _GUICtrlListView_GetSelectedIndices($hFTP_List, True)
$curftpdir = _FTP_DirGetCurrent($conn)
For $i = 1 To $selectedftp[0]
$text = _GUICtrlListView_GetItemText($hFTP_List, $selectedftp[$i], 0)
$type = _GUICtrlListView_GetItemText($hFTP_List, $selectedftp[$i], 1)
If $type = 'DIR' Then
_FTPRemovedir($curftpdir & '/' & $text)
_FTP_DirSetCurrent($conn, $curftpdir)
$del = _FTP_DirDelete($conn, $text)
If $del = 1 Then
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $curftpdir & '/' & $text & ' Directory Deleted' & @CRLF)
EndIf
Else
$del = _FTP_FileDelete($conn, $text)
If $del = 1 Then
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $curftpdir & '/' & $text & ' File Deleted' & @CRLF)
EndIf
EndIf
Next
_GUICtrlListView_DeleteItemsSelected($hFTP_List)
_FtpRefresh()
EndFunc ;==>_FTPdelete

Func _FTPRemovedir($FTPdir)
Local $changeDir, $list
_FTP_DirSetCurrent($conn, $FTPdir)
$list = _FTP_ListToArrayEx($conn, 0)
If IsArray($list) Then
For $i = 1 To $list[0][0]
If $list[$i][2] = 16 Then
_FTPRemovedir($FTPdir & '/' & $list[$i][0])
_FTP_DirSetCurrent($conn, $FTPdir)
_FTP_DirDelete($conn, $list[$i][0])
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $FTPdir & '/' & $list[$i][0] & ' Directory Deleted' & @CRLF)
Else
_FTP_FileDelete($conn, $list[$i][0])
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $FTPdir & '/' & $list[$i][0] & ' File Deleted' & @CRLF)
EndIf
Next
EndIf
EndFunc ;==>_FTPRemovedir


test 1 Ftp server make dir ( aa )
/aa

make dir /aa/aa
_ftp_delete (/aa/aa) test ok
_ftp_delete (/aa) not delete test fail


test 2 _FTP_ProgressDownload2 -> test fail
file value /aa/test.txt 10kb
_FTP_ProgressDownload2 -> /aa/test.txt 0kb
I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript] Korea of cafe(blog) to be operating, English cannot well.Many help it requests.To read, it stands it thanks.

#13 Beege

Beege

    Universalist

  • MVPs
  • 843 posts

Posted 07 October 2009 - 08:44 AM

@davidkim

_ftp_delete (/aa/aa) test ok _ftp_delete (/aa) not delete test fail


Ahh I'm not sure thats a bug. That function is written to delete the items that are selected in the GUI, not what you put in parentheses. So I dont know how that first test turned out ok. If your trying to pull fuctions from my script, be sure to understand how they work because alot of them are NOT written to be some kind of a UDF. They are written to work with the rest of the script.

Edited by Beege, 07 October 2009 - 08:49 AM.


#14 SimonWebstation

SimonWebstation

    Seeker

  • Active Members
  • 15 posts

Posted 07 October 2009 - 06:23 PM

Very nice Script
mfg. SimonMany of my answers are translated of google, because I'am from Germany

#15 Beege

Beege

    Universalist

  • MVPs
  • 843 posts

Posted 08 October 2009 - 03:20 AM

Very nice Script

Thankyou!

#16 davidkim

davidkim

    Adventurer

  • Active Members
  • PipPip
  • 100 posts

Posted 16 October 2009 - 02:37 AM

Ftp root\subFolder not delete Fix....

UDF ->

Func _FTPdelete()
Local $selectedftp, $i, $curftpdir, $del
$id = MsgBox(36, 'Confirm File Delete', 'Are you sure you want to delete selected files?')
If $id = 7 Then Return
$selectedftp = _GUICtrlListView_GetSelectedIndices($hFTP_List, True)
$curftpdir = _FTP_DirGetCurrent($conn)
For $i = 1 To $selectedftp[0]
$text = _GUICtrlListView_GetItemText($hFTP_List, $selectedftp[$i], 0)
$type = _GUICtrlListView_GetItemText($hFTP_List, $selectedftp[$i], 1)
If $type = 'DIR' Then
_FTPRemovedir($curftpdir & '/' & $text)
_FTP_DirSetCurrent($conn, $curftpdir)
$del = _FTP_DirDelete($conn, $text)
If $del = 1 Then
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $curftpdir & '/' & $text & ' Directory Deleted' & @CRLF)
EndIf
Else
$del = _FTP_FileDelete($conn, $text)
If $del = 1 Then
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $curftpdir & '/' & $text & ' File Deleted' & @CRLF)
EndIf
EndIf
Next
_GUICtrlListView_DeleteItemsSelected($hFTP_List)
_FtpRefresh()
EndFunc ;==>_FTPdelete

Line Edit --->

If $type = 'DIR' Then
_FTPRemovedir($curftpdir & '/' & $text)
_FTP_DirSetCurrent($conn, $curftpdir)
$del = _FTP_DirDelete($conn, $text)

To..

If $type = 'DIR' Then
$del_dir = $curftpdir & '/' & $text
If StringTrimLeft($del_dir, 2) = $text Then
_FTPRemovedir('/' & $text)
Else
_FTPRemovedir($curftpdir & '/' & $text)
EndIf
_FTP_DirSetCurrent($conn, $curftpdir)
$del = _FTP_DirDelete($conn, $text)

------- Delete root\subFolder


All Script.....>

Func _FTPdelete()
Local $selectedftp, $i, $curftpdir, $del
$id = MsgBox(36, 'Confirm File Delete', 'Are you sure you want to delete selected files?')
If $id = 7 Then Return
$selectedftp = _GUICtrlListView_GetSelectedIndices($hFTP_List, True)
$curftpdir = _FTP_DirGetCurrent($conn)
For $i = 1 To $selectedftp[0]
$text = _GUICtrlListView_GetItemText($hFTP_List, $selectedftp[$i], 0)
$type = _GUICtrlListView_GetItemText($hFTP_List, $selectedftp[$i], 1)
If $type = 'DIR' Then
$del_dir = $curftpdir & '/' & $text
If StringTrimLeft($del_dir, 2) = $text Then
_FTPRemovedir('/' & $text)
Else
_FTPRemovedir($curftpdir & '/' & $text)
EndIf
_FTP_DirSetCurrent($conn, $curftpdir)
$del = _FTP_DirDelete($conn, $text)

If $del = 1 Then
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $curftpdir & '/' & $text & ' Directory Deleted' & @CRLF)
EndIf
Else
$del = _FTP_FileDelete($conn, $text)
If $del = 1 Then
_check_status()
_GUICtrlEdit_AppendText($hStatus_List, $curftpdir & '/' & $text & ' File Deleted' & @CRLF)
EndIf
EndIf
Next
_GUICtrlListView_DeleteItemsSelected($hFTP_List)
_FtpRefresh()
EndFunc ;==>_FTPdelete

But... Error is _FTP_ProgressDownload Function
Download File Size 0kb....
I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript] Korea of cafe(blog) to be operating, English cannot well.Many help it requests.To read, it stands it thanks.

#17 davidkim

davidkim

    Adventurer

  • Active Members
  • PipPip
  • 100 posts

Posted 16 October 2009 - 02:42 AM

#include <Array.au3>
#include <FTPEx.au3>

$serv = "192.168.1.205"
$user = "user"
$pass = "pass"

$FTP = _FTP_Open("TEST")
$FTPServer = _FTP_Connect($FTP,$serv,$user,$pass,1)
_FTP_DirSetCurrent($FTPServer,'au3')

ProgressOn("Download","Downloading *.au3 files",'', -1 , @DesktopHeight / 2 - 100)

$file2Darray = _FTP_ListToArray2D($FTPServer)

Global $filesizetot=0, $filename[1], $filesize[1], $filecount=0, $filesizeprogress=0

For $i=3 To $file2Darray[0][0]
If StringInStr($file2Darray[$i][0],'.au3')<>0 Then
$filesizetot+=$file2Darray[$i][1]
_ArrayAdd($filename,$file2Darray[$i][0])
_ArrayAdd($filesize,$file2Darray[$i][1])
$filecount+=1
EndIf
Next

DirCreate('au3')

For $i=1 To $filecount
$x=_FTP_ProgressDownload($FTPServer,'au3\' & $filename[$i],$filename[$i],'_updateprogress')
FileWriteLine(@ScriptDir & '\down.txt','au3\' & $filename[$i])
Next
ProgressSet(100)

_FTP_Close($FTPServer)
_FTP_Close($FTP)

Sleep(2000)
ProgressOff()

Func _updateprogress($percent)
$filesizeprogress = Round(100 / $filesizetot * ($filesizeprogress + ($filesize[$i] /100 * $percent)) + (100 / $filecount * $i),0)
ConsoleWrite('size ' & $filesizetot & @LF)
FileWriteLine(@ScriptDir & '\down.txt','size ' & $filesizetot)
ProgressSet($filesizeprogress, $filename[$i] & ' ' & $percent & '%' )
Return 1
Endfunc

i'm test write file -> file list -> down.txt
i'm test write size file -> file size -> down_size.txt

down.txt
size 297355
au3\adopter.au3
size 297355
au3\Ask_TargetDisk.au3
size 297355
au3\cpu.au3
size 297355
au3\diskpart.au3
size 297355
au3\dpdemo.au3
size 297355
au3\dpdemo.au3.url
size 297355
au3\IE_T2.0_4.au3
size 297355
au3\IE_V1Compatibility_T2.0_4.au3
size 297355
au3\login.au3
size 297355
au3\resive.au3
size 297355
au3\sender.au3
size 297355
au3\SMART.au3
size 297355
au3\SMART_WMI.au3
size 297355
au3\test2.au3
size 297355
au3\win32.au3
size 297355
au3\Windows_Resizer.au3
size 297355
au3\yahoo_login.au3

down_size.txt
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript] Korea of cafe(blog) to be operating, English cannot well.Many help it requests.To read, it stands it thanks.

#18 Beege

Beege

    Universalist

  • MVPs
  • 843 posts

Posted 16 October 2009 - 04:08 AM

@davidkim
Thanks for looking at my script so much. You should take a look at my current ftp script if your intrested. I have made alot of changes since the origonal post. I figured out how to implement callback function so I dont even use _FTP_ProgressDownload() any more. As of right now it will only work with AutoIT v3.3.1.1 Beta. Something is going on with the new beta. _GUICtrlStatusBar_EmbedControl() keeps failing.



Remember its no way near finished but should still work fine.

Edit: _GUICtrlStatusBar_EmbedControl() should be fixed in v3.3.1.4 beta

Edited by Beege, 16 October 2009 - 10:23 PM.


#19 davidkim

davidkim

    Adventurer

  • Active Members
  • PipPip
  • 100 posts

Posted 16 October 2009 - 07:05 AM

@davidkim
Thanks for looking at my script so much. You should take a look at my current ftp script if your intrested. I have made alot of changes since the origonal post. I figured out how to implement callback function so I dont even use _FTP_ProgressDownload() any more. As of right now it will only work with AutoIT v3.3.1.1 Beta. Something is going on with the new beta. _GUICtrlStatusBar_EmbedControl() keeps failing.



Remember its no way near finished but should still work fine.

thanks Beege i'm download FTP Explorer NEW.au3
after test .......
After a while I will upload the My source
Please wait ...
I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript] Korea of cafe(blog) to be operating, English cannot well.Many help it requests.To read, it stands it thanks.

#20 Beege

Beege

    Universalist

  • MVPs
  • 843 posts

Posted 16 October 2009 - 10:35 PM

@davidkim
Also when posting code try to remember to put it in a codebox. This way it will have all the color syntax and will not be such a long post. Look for button with the autoit symbol in the toolbar. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users