Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

InteXX

martin wrote:

Thanks for your response.

You're welcome :-)

Thanks,
Jeff Bowman
Fairbanks, Alaska
martin

InteXX wrote:

You're on the right track, then... my example is intended to demonstrate the concept only. It sounds like you already understand the concept.

In fact this is the way any application would do it, including WinSCP. It downloads the file to a temp folder, opens it with the appropriate editor, saves it, and then uploads it back to the source.

All that's left for you to do now is find an editor for ASP.NET that can work with your file type. That task is beyond the scope of this forum, of course, but you've already got a good head start on the job.

Thanks for your response. I just confirm that this is the correct answer!
InteXX

You're on the right track, then... my example is intended to demonstrate the concept only. It sounds like you already understand the concept.

In fact this is the way any application would do it, including WinSCP. It downloads the file to a temp folder, opens it with the appropriate editor, saves it, and then uploads it back to the source.

All that's left for you to do now is find an editor for ASP.NET that can work with your file type. That task is beyond the scope of this forum, of course, but you've already got a good head start on the job.

Best of luck to you; signing off now...

Jeff Bowman
Fairbanks, Alaska
luismdmauricio

Hi Jeff,

Thanks for your help!

My asp.net application is more complicated. I need explicity to use word files and I do not want to use Interop to it because of the security issues in server side.

I've tried your approach using Telerik RadEditor but the documents that will be managed need to use diagrams, texboxes, etc. that will be used to explain the corresponding text paragrahs. So , RadEditor is not sufficent :-(

Thats why I remender the Edit menu option in the WinSCP application.

Best regards
InteXX

luismdmauricio wrote:

Hi, thanks for the repply

I forgot to mention that its an asp.net application, so I need to open the file directly from a local folder from within asp.net application. All examples that I saw in web are for download file not to open it.

Thanks
Best regards

Here you go, try this:

Public Class Welcome

  Inherits Page

  Protected Sub Page_Load(Sender As Object, e As EventArgs) Handles Me.Load
    ' First use WinSCP to download your file from the server

    ' Then send the file contents to a multi-line TextBox
    txtWebPageTextEditorField.Text = System.IO.File.ReadAllText(Request.MapPath("~/Files/DownloadedFile.txt"))
  End Sub

  Private Sub cmdSave_Click(Sender As Object, e As EventArgs) Handles cmdSave.Click
    ' Save the file after editing
    System.IO.File.WriteAllText(Request.MapPath("~/Files/DownloadedFile.txt"), txtWebPageTextEditorField.Text)

    ' Now use WinSCP to upload your file back to the server you got it from
  End Sub
End Class

This of course assumes you're working with a text file. If it's binary you're going to need special handling.

Jeff Bowman
Fairbanks, Alaska
luismdmauricio

Hi, thanks for the repply

I forgot to mention that its an asp.net application, so I need to open the file directly from a local folder from within asp.net application. All examples that I saw in web are for download file not to open it.

Thanks
Best regards
InteXX

Re: Edit Remote File Using .NET assembly

luismdmauricio wrote:

Hello,

Is it possible to implement code using .net assembly, to do same action like in the FTP Client to EDIT a remote file?

I need to implement in my application a connection to a remote server, select a file, edit it and, when finished, upload it back to the remote server. That's exactly what is donne in the "Edit With" option of the WinSCP Client Application.

Thanks in advance.
Best regards

You might want to try downloading, editing, and then uploading:

https://winscp.net/eng/docs/library#using

Jeff Bowman
Fairbanks, Alaska
luismdmauricio

Edit Remote File Using .NET assembly

Hello,

Is it possible to implement code using .net assembly, to do same action like in the FTP Client to EDIT a remote file?

I need to implement in my application a connection to a remote server, select a file, edit it and, when finished, upload it back to the remote server. That's exactly what is donne in the "Edit With" option of the WinSCP Client Application.

Thanks in advance.
Best regards