• Post Reply Bookmark Topic Watch Topic
  • New Topic

write a file from liux to windows  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
I have a java web app which writes a pdf file (using a java.io.File through a FileOutpuStream), reading the path in a .properties file.
But my was5 server is on a linux machine and I want to write it on a windows machine.
How to write the path in the properties file? (something like \\machinename\D$\directoryname? as in windows?)
Must I configure the access rights in order to authorize root to have access to my windows machine?
Is there a filesystem issue between linux and windows?
thanks for help
 
Tim Holloway
Saloon Keeper
Posts: 18799
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A web server is not a file server.
If you place a PDF file in a place where your webserver knows that it's supposed to copy it to the user's web client (browser) program, the PDF will be transmissted, and depending on the browser, it's MIME settings, and the Content-Disposition header you supply, the user may be offered a File Save dialog allowing him/her to select the location and name where the copy of the PDF is to be stored. Or, alternatively, the PDF will simply launch in the user's copy or Acrobat Reader (or Linux xpdf).
However, if you actually want a Windows user/program to be able to access the PDF as though it was a regular data file - including being able to browse it via the Windows Explorer, you need to set up a file server, and one that's compatible with Windows Networking.
Linux has a very nice system for that purpose. It's called Samba (http://www.samba.org). It allows you to define file shares, printer shares, login scripts, home directories, and pretty much everything else a machine running Windows NT/2000 Server does. In fact, to a Windows network client, the server will then look just like a Windows machine!
One machine can host multiple types of servers, so the same computer that hosts your web server can also server as a Samba server as well.
The trip goes both ways - a Samba client can access Windows shares. The only difference is that backslashes are Unix escape characters, so you use forward slashes in the UNC names. That is, instead of \\MASTER\TIM, a share would appear on the Linux side as //MASTER/TIM
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!