0

I want to do SFTP file transfer in GWT.

I have file upload page on click SUBMIT button, the uploaded file has to be transfered. how to perform this in GWT?

dhana
  • 21
  • 2
  • 7
  • What have you tried? Are you sure you know what SFTP is/means and what does it have to do with submitting a file via a form? Please show that you have done some research before asking this question - there are already plenty of answers, articles, etc. on how to submit a file to a server using GWT. – Igor Klimer Feb 03 '15 at 13:38
  • yes, i have used the file upload form.. form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() { public void onSubmitComplete(SubmitCompleteEvent event) { Window.alert(event.getResults()); } sftp file transfer has to be implemented as submit handler. – dhana Feb 04 '15 at 10:03

1 Answers1

0

You cannot perform a FTP file transfer through a web browser. With GWT, you can send a file to your server with a FileUpload widget (http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/FileUpload.html).

Edit: You have to do this in two steps : Send your file to your server through a form (FileUpload). Send this file from your HTTP server to your FTP server (how to transfer a file through SFTP in java?).

Community
  • 1
  • 1
PapaStan
  • 237
  • 4
  • 11
  • yes, i have used the file upload form.. form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() { public void onSubmitComplete(SubmitCompleteEvent event) { Window.alert(event.getResults()); } sftp file transfer has to be implemented as submit handler. – dhana Feb 04 '15 at 02:02
  • i will be using this code on server side. http://stackoverflow.com/questions/14830146/how-to-transfer-a-file-through-sftp-in-java I want to know how to put this code on submit select handler. on submit, the file uploaded should be transfered. – dhana Feb 04 '15 at 10:05
  • should i have to go for interface methods like Async for sftp connection? – dhana Feb 04 '15 at 10:07
  • You seem to lack an understanding of what the clientside and serverside is. The gwt code runs on the client and runs as javascript while the serverside code could be anything (java, php,...). The clientside is the actual button and the server side is the initial receiver of the file data being uploaded. – AnAmuser Feb 07 '15 at 23:02