Taken from the example you mention:

|File newFile = new File(getUploadFolder(), upload.getClientFileName());

||newFile.createNewFile();
upload.writeTo(newFile);

Above writes to the file..

This lets you traverse  through the directory..:

|

private Folder uploadFolder = null;


uploadFolder = new Folder(System.getProperty("mysubFolder  "), 
"wicket-uploads");
                // Ensure folder exists
                uploadFolder.mkdirs();


folder.getFiles()[1].toURL() should give the direct url for the file, now if 
you want to serve if through wicket then you got to use resources.. Otherwise 
just create some externalLinks and that should be it..


regards


Pierre G wrote:
Thanks Nino,

Sorry, I dont understand. Please be more detailed.
I try to use Folder from util.file package
            uploadFolder = new Folder(?, "DownloadedFiles");
then can I use the folder as resource ? how ?

I still dont have any idea how to have my uploadFolder in the context ....


Nino.Martinez wrote:
Theres file in utils package.. Producing a url for that could be mounting a resource and using the urlfor...

Pierre Gilquin wrote:
I try to modify the upload example
(http://www.wicket-library.com/wicket-examples/upload/single)  for my own
need.
I would like to be able to upload the file in a directory under my
context (ie. tomcat_install/webapps/MyApp/DownloadedFiles) and generate
the corresponding internet url for the files (ie.
http://localhost:8080/MyApp/DownloadedFiles/file1)

How can I get the local and internet paths from my appli. ?

Thanks in advance


Pierre
--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to