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

Advertisement

gabecracia
Joined:
Posts:
1
Location:
Brazil

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,253
Location:
Prague, Czechia

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");

Reply with quote

Frittenreinhold
Joined:
Posts:
1

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

Reply with quote

Advertisement

You can post new topics in this forum