Author Topic: How to ftp upload my current (saved) buffer/file  (Read 9115 times)

deuse

  • Community Member
  • Posts: 33
  • Hero Points: 0
How to ftp upload my current (saved) buffer/file
« on: November 16, 2007, 12:28:26 PM »
Hi,

I often have to edit and upload the same .php-file using ftp to a web site. I want to be able to do this with only one keystroke (I want to avoid having to change from keyboard to mouse and then having to fumble around in the ftp client window). Of course, I would open the appropriate ftp session before doing this (keeped alive). So we can presume that there is a ftp connection when pressing the key.

Is there a slick command which I can use for this?

I tried several ftp...-commands, e.g. ftpupload, but this didn't work (-> "Command is disabled for this object). Maybe ftpupload is the wrong command, but I didn't find a documentation for the ftp...-commands, sorry, and the ftp-commands source doesn't contain much useful comments.

Thanks for your help!

Rudi



Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 798
  • Hero Points: 54
Re: How to ftp upload my current (saved) buffer/file
« Reply #1 on: November 16, 2007, 02:59:01 PM »
The correct command is 'ftpUpload'.

For this command to work, the active window MUST be the window with the 'ftp://...' file you are attempting to upload. I have tested this successfully on 12.0.3.

Good luck.

--rodney

deuse

  • Community Member
  • Posts: 33
  • Hero Points: 0
Re: How to ftp upload my current (saved) buffer/file
« Reply #2 on: November 17, 2007, 11:15:52 AM »
Sorry, but I don't understand this. What do you mean with "ftp://...-file"? Of course I invoke the ftpupload command only when the file to be uploaded is my actual window.
Greets
Rudi

Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 798
  • Hero Points: 54
Re: How to ftp upload my current (saved) buffer/file
« Reply #3 on: November 17, 2007, 01:31:24 PM »
The file you use ftpUpload on must have been opened with SlickEdit's FTP client. When you use our FTP open tab (View>Toolbars>FTP) to open an FTP (or SFTP) file, the file name shows up with 'ftp://' on the front. Example:

ftp://ftp.slickedit.com/README.TXT

--rodney

deuse

  • Community Member
  • Posts: 33
  • Hero Points: 0
Re: How to ftp upload my current (saved) buffer/file
« Reply #4 on: November 19, 2007, 09:16:59 AM »
Hi Rodney:

This works (I didn't work with loading REMOTE files). Thanks so far!

But it doesn't solve my problem, since I've got / I want to edit a LOCAL file (in my special directory structure, not in the Slick-tmp-path), and upload a copy of it.

Maybe we should try a different approach. Is there a slick command similar to the following?

ftpSomeUploadCommand FileNameOfMyLocalStoredFile.egPhp

With this I could write a slick function, which uploads all my files "in one go" (by calling it for each of my files). This upload command would use the open ftp connection. Maybe there are or would be other command variants, which have parameters for dest filename, connection name etc.

TIA
Rudi


Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 798
  • Hero Points: 54
Re: How to ftp upload my current (saved) buffer/file
« Reply #5 on: November 19, 2007, 05:11:14 PM »
Well, there is a (somewhat) (un)supported command called ftpCopy that will do what you want. I had to modify it a little to support active connections on the FTP Open tool window in addition to the FTP Client tool window. I also added a +prompt switch to support prompting for the connection profile when it cannot be determined (e.g. you're not connected to anything).

The modified ftp.e is attached. It is for v12.0.3. Load it from Macro>Load Module. See the comment for docs on options and return status. Here is a quick example from the SlickEdit command line:

ftpCopy d:\local\path\to\filename.ext ftp://hostname/path/filename.ext

IMPORTANT: The remote file path MUST have the filename part (filename.ext in example above).

--rodney

deuse

  • Community Member
  • Posts: 33
  • Hero Points: 0
Re: How to ftp upload my current (saved) buffer/file
« Reply #6 on: November 20, 2007, 05:01:03 PM »
It works. Great! :D Thank you very much!!! ;D

BTW: I assume that you are aware that your prompt-flag is only set, but not used. I don't need it, just wanted to tell you.

Greetings
Rudi