Sign in to follow this  
Followers 0
Beege

FTP Explorer - Updated 3-17-2010

35 posts in this topic

#1 ·  Posted (edited)

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.

post-8949-12688513776548_thumb.gif post-8949-12688514009816_thumb.gif

FTP Explorer 3-17-10.zip

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

FTP Explorer 1-27-2010.zip

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.

FTP Explorer 1-10-10.zip

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!!

FTP_Explorer.au3

Edited by Beege
1 person likes this

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

thanks for sharing!

beautiful scripts !

Share this post


Link to post
Share on other sites

can somebody link the ftp_ex.au3?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Edited by ProgAndy

*GERMAN* [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

Share this post


Link to post
Share on other sites

Nice work

Thanks

Share this post


Link to post
Share on other sites

thank you,but it has some problems when changing dirs

Share this post


Link to post
Share on other sites

thank you,but it has some problems when changing dirs

What kind of problems?

Share this post


Link to post
Share on other sites

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[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

@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

Share this post


Link to post
Share on other sites

Very nice Script


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

Share this post


Link to post
Share on other sites

Very nice Script

Thankyou!

Share this post


Link to post
Share on other sites

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[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Share this post


Link to post
Share on other sites

#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[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

@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

Share this post


Link to post
Share on other sites

@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[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Share this post


Link to post
Share on other sites

@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. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0