hey all, i have a project that is like a server and a terminal interface. the server is the one that can only make changes in the database and the terminal is more of storing what is in the database. here is the problem, i have stored a PDF file path in the database through the use of the server, but the problem is that i cant seem to display it on the terminal. i was thinking that the terminal was assuming that the file path was stored in its local hard drive. can u please help on how will i specify that the file path is on the local hard disk of the server and not on its local hard disk?

Dani AI

Generated

As explains, the terminal is trying to open the path on its own machine — so a server-local path like C:\... won’t work from a different PC. ’s suggestion to use a network-accessible path is the right idea. Practical options, ranked by simplicity and control: store a UNC share path that every terminal can reach, store an HTTP(S) URL served by the server (download on demand), or store the file bytes (or use SQL FILESTREAM) and have the terminal fetch them.

Key implementation points and pitfalls to check:

  • Prefer UNC (network share) instead of mapped drive letters because mapped drives are per-user/session; services and other users often won’t see them. Use a path the terminal can actually access (for example \\ServerName\Share\folder\file.pdf).
  • Ensure both share and NTFS permissions grant read access to the account under which the terminal app runs. If the terminal runs as a Windows service, use a domain service account or implement impersonation — LocalSystem/NetworkService usually lack the needed rights.
  • Test access from the terminal machine first (Windows Explorer or dir \\ServerName\Share\...). Check firewall/SMB (port 445) and DNS/NetBIOS name resolution; use FQDN if necessary.
  • If you expose files over HTTP, secure the endpoint (authentication + HTTPS). If you store files in the DB, consider backup/size/performance tradeoffs.

Concrete VB.NET patterns:

Dim path As String = "\\ServerName\Share\file.pdf"
If IO.File.Exists(path) Then
    Process.Start(New ProcessStartInfo With {.FileName = path, .UseShellExecute = True})
Else
    MessageBox.Show("File not found: " & path)
End If

Or, if you publish files via HTTPS on the server, download then open:

Dim url As String = "https://server.example.com/files/file.pdf"
Dim tmp = IO.Path.Combine(IO.Path.GetTempPath(), IO.Path.GetFileName(url))
Using wc As New Net.WebClient()
    wc.DownloadFile(url, tmp)
End Using
Process.Start(tmp)

Checklist summary: store paths terminals can reach (UNC or URL), give the terminal process the right permissions, test remotely, and choose sharing vs HTTP vs DB storage based on security and deployment constraints.

Recommended Answers

All 2 Replies

anyone?

anyone?

have you tried storing the path as UNC?

i.e. instead of C:\MYFOLDER try \\machinename\drive\MYFOLDER

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.