• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
reply
    Bookmark Topic Watch Topic
  • New Topic