[Logo]
Forums Register Login
[Newbie][SmartUpload] [Tomcat] : open download browser in a selected folder
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>
Why is the word "abbreviation" so long? And this ad is so short?
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 1492 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 16, 2018 06:13:38.