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

martin

@Frittenreinhold: The PowerShell code will be pretty much an equivalent of the C# code above:
$session.PutFile(New-Object System.IO.MemoryStream, "/remote/path/file.txt")
Frittenreinhold

Hi Martin!

I've registered to the forums to ask for the same question – how to use the API to create a new file on the remote host like the new item context menu in the GUI.

Do you have an example for a similar method of MemoryStream or an alternative smooth solution for PowerShell by chance?

Thx
martin

Re: How can i create a new empty file in remote server?

I do not understand what you ask for. So upload an empty file.
If you are asking for to upload an empty file without creating an empty local file to upload, you can use Session.PutFile and an empty MemoryStream (though we do not even know what language are you using, the following is a C# example):
session.PutFile(new MemoryStream(), "/remote/path/file.txt");
gabecracia

How can I create a new empty file in remote server?

I need that every time that I create a new folder (which is already coded) an empty index.html file be created, so I can avoid LFI vulnerability.