This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes How to upload files to windows network shared drive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to upload files to windows network shared drive" Watch "How to upload files to windows network shared drive" New topic
Author

How to upload files to windows network shared drive

rahulJ james
Ranch Hand

Joined: Oct 03, 2008
Posts: 123
I am building an application with struts 2 FW. I wanted to have a plage where the user should be able to upload a word doc to the network drive. Any suggestions
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Please take the time to choose the correct forum for your posts. This forum is for questions on HTML and JavaScript. For more information, please read this.

This post has been moved to a more appropriate forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's "FW"?

Just upload the file normally then copy it. What specific problem are you having?
rahulJ james
Ranch Hand

Joined: Oct 03, 2008
Posts: 123
FW - framework
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
If you're doing this on a non-Windows platform then you'll need to use a library like jCIFS that understands SMB so it can access Windows shared drives. But the jCIFS API is just about identical to the java.io classes (in particular, File and File[In|Out]putStream) so you should have little problem converting your code.


Ping & DNS - updated with new look and Ping home screen widget
rahulJ james
Ranch Hand

Joined: Oct 03, 2008
Posts: 123
Thanks.. I am building in the windows and later I will be moving this application to the unix environment. Will I be having any issues with this.

I connect to the windows shared drive through the File.io and I am able to create folders. My concern is how to upload the file to the desired location

Advise
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18155
    
    8

rahulJ james wrote:Thanks.. I am building in the windows and later I will be moving this application to the unix environment. Will I be having any issues with this.
If you're asking about jCIFS, it's pure Java. I use it to move files from an IBM System i (a.k.a. iSeries a.k.a. AS/400) to Windows machines. So it should work on Unix boxes too.
I connect to the windows shared drive through the File.io and I am able to create folders. My concern is how to upload the file to the desired location
I know very little about Struts but from the questions I've seen here it looks to me like file uploading is built into it somehow.
rahulJ james
Ranch Hand

Joined: Oct 03, 2008
Posts: 123
If it is pure java.. So am I going in the right direction by using file.io or Somethingelse I have to look into..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
I think you somehow missed my previous post...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to upload files to windows network shared drive
 
Similar Threads
writing to network drive
How to upload files to the windows shared network drive
Save as dialog box ?
Access Network drive through Java Application running as a service
Servlet-File-Upload