Using UNC file names in Servlet (Apache/JServ)

Using UNC file names in Servlet (Apache/JServ)

Post by manu » Fri, 07 May 1999 04:00:00



Hello,

I have written a servlet to upload files to a network drive. I've
tried to use the UNC pathname but it doesn't work. The message that I
receive is :"...FileNotFoundException...access denied". With a normal
pathname (e.g. d:\InetPub\upload ) it works without problems.
In this example, you can see basicaly what I've done . I've omitted
great part of the code because the problem is here.

(Platform is Intel Windows NT 4.0 Server, running Apache 1.3.6 with
JServ 1.0 B3)

public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{

PrintWriter out = res.getWriter();

try
{

String strTest = new String("Testing UNC with OutputStream ");
byte buffer[] = null;
buffer = strTest.getBytes();
File file = new File("\\\\gws1\\InetPub\\testit.txt");
FileOutputStream fout= new FileOutputStream (file);

fout.write(buffer);
fout.close();

Quote:}

catch (Exception e)
{
out.println(e.toString());

Quote:}

....

I have tried various variations of the FileOutputStream consturctor,
i.e. with a String paramater (either drive-mapped or UNC names, with
both doubled back-slashes or forward slashes), or as File object.

If anyone could offer any advice, I would be extremely grateful!

Thanks,

Manuel Burgada

 
 
 

1. Apache JServ and servlet using non-public classes within the same .java file

Hello -- I got Apache JServ 1.0 up and running on Solaris.  I got some
simple test servlets going, but then I discovered that if my servlet .java
file has additional classes defined within it, and they are used within the
main public HttpServlet class, then I keep getting ClassNotFound exceptions
(or something like that).    It seems like the servlet runner cannot find
these private classes within the same class file.  (I can get it to work by
combining everything into one class and removing the use of these classes).

I have no problem instantiating classes that are public and defined
elsewhere in a .jar file and I've included them in the classpath via the
.conf files.

Has anyone seen this before?  Is there something I missed in the
configuration files?

Thanks

Betty

2. vpn/ipsec question

3. Multiprocessing for Webserver using Apache/JServ with Servlets

4. KDE 3 Rdehat 7.2 Readme?

5. Problem with servlets using Apache and Jserv

6. Migrate Users from one server to another running AIX 4.3.2

7. Problem with Apache+JServ+Servlets delivering gzipped Files

8. Problems with AT1500 ethernet network card

9. Apache Jserv / java servlets under FreeBSD Apache

10. Access WinNT files from Linux using UNC names (not mounts)

11. jserv for apache : JServUtils.java:66: Class javax.servlet.http.Cookie not found in import.

12. Apache/Jserv/Servlets/Memory

13. Apache Jserv - Servlet question