Is there a command that change's server's file's inside buffer?
Change file's inside text?
I hope you understand me

Dani AI

Generated

Thread follow-up for : the phrase "change server's file's inside buffer" most likely means "modify the contents of a file that lives on the server." The method depends on where the Visual Basic code runs:

  • If the code runs on the server (ASP.NET, Windows service, scheduled task), use the System.IO APIs to read/modify/write the file.
  • If the code runs on a client, the server must be asked to perform the write (HTTP handler, FTP/SFTP, WebDAV, or an upload endpoint).

Server-side VB.NET (ASP.NET) — overwrite a text file:

' server-side (ASP.NET / VB.NET)
Dim path As String = Server.MapPath("~/data/example.txt")
Dim newText As String = "Replacement content"
System.IO.File.WriteAllText(path, newText, System.Text.Encoding.UTF8)

Classic ASP (VBScript) — FileSystemObject:

' classic ASP (VBScript)
Dim fso, f, path, newText
Set fso = Server.CreateObject("Scripting.FileSystemObject")
path = Server.MapPath("/data/example.txt")
Set f = fso.OpenTextFile(path, 2, True)  ' 2 = ForWriting
f.Write newText
f.Close
Set f = Nothing
Set fso = Nothing

Remote/client update options: POST the new content to a server-side uploader endpoint (preferred for web apps), or use FTP/SFTP when no HTTP endpoint exists. Common pitfalls: file permissions (IIS app pool identity must have write rights), file locks (handle IOExceptions and use retry logic), caching (server or browser caches can hide changes), and buffered writes (use Using blocks or call Flush/Close). Security cautions: never write raw client data to server files without validation, keep backups, and avoid changing application code files at runtime. As and noted, additional environment details (classic VB vs VB.NET, running location, server OS) determine the exact code and permissions required.

Recommended Answers

All 2 Replies

Ahhh!!! I see dead threads!!!!

lashatt2,

Please in the future start your own thread and if need be, copy the url into your new thread. And NO, I don't understans so please start your very own thread and if you really need to, copy this threads url into yours.

Good Luck

Please in the future start your own thread

I've split the posts from the other thread, but have no clue what the OP is asking, hence the thread-title.
In the future, you can click the 'flag bad post' link and a moderator will come along and split the thread in half :icon_smile:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.