• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

[Newbie][SmartUpload] [Tomcat] : open download browser in a selected folder  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, im a newbie in java and i've to download some files from Tomcat's folder. But, for security purposes, i've to open the browser directly in a selected folder. Unfortunatly, i didn't succeed with the JspSmartUpload's API. Although the browser opens and th download works great, i dont know which method to use to open my browser in the folder i want(or if i can do this in html). I tried the getCollection method without success and my research didnt have hoped results.
Any suggestion would be grantly appreciatted
Here is my code:
<%@ page language="java" import="com.jspsmart.upload.*" contentType="text/html; charset=iso-8859-1" %>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<HTML> <BODY BGCOLOR="white">
<H1>Downloading a doc</H1> <HR>


<%

/****take back the parameter "CourseName" from a html Form****/
String NomEns = request.getParameter("courseName");
String path = "C:\\Tomcat 4.1\\webapps\\MSI\\course\\";
System.out.println("course" +courseName);


/******instanciating the upload******/

mySmartUpload.initialize(pageContext);
mySmartUpload.setTotalMaxFileSize(100000);
mySmartUpload.upload();





/********selected file put in a collection Files and take the name at index (0) *******/

com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
String File_Name = myFile.getFileName();
System.out.println("file" +File_Name);



/****final_path***/
String final_path = path.concat(NomEns).concat("\\").concat("Cours").concat("\\");

/*****call the download method****/

mySmartUpload.downloadFile(final_path);
%>
</BODY> </HTML>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!