[opencms-dev] File Upload with more then 1 file upload fields
Nico Krause
Nico.Krause at nsc.eu.com
Fri Dec 13 10:43:07 CET 2002
This is cool - thanks Marian!
Hava a nice weekend!
Nico
-----Original Message-----
From: Marian Kasala [mailto:marian.kasala at apsoft.sk]
Sent: Freitag, 13. Dezember 2002 09:11
To: opencms-dev at www.opencms.org
Subject: Re: [opencms-dev] File Upload with more then 1 file upload fields
Hi Nico,
I use following code in one of my PDF file upload form in backoffice.
It was intended for multi-language pdf upload.
inside form definition:
<input type="file" name="pdf_de">
<input type="file" name="pdf_it">
<input type="file" name="pdf_fr">
inside controlling class:
String pdfDe = (String) parameters.get("pdf_de");
if (pdfDe != null && pdfDe.length() != 0 && !pdfDe.equals("unknown")) {
byte[] pdf = cms.getRequestContext().getRequest().getFile(pdfDe);
if (pdf != null) {
// to do whatever needed
}
}
...
...
Best Regards,
Marian Kasala
AP Soft GmbH
Pod juhom 1
SK-911 01 TrencĂn
Tel.: +421 32 7480056
Fax: +421 32 7480053
----- Original Message -----
From: Nico Krause <mailto:Nico.Krause at nsc.eu.com>
To: opencms-dev at opencms.com <mailto:opencms-dev at opencms.com>
Sent: Thursday, December 12, 2002 4:58 PM
Subject: [opencms-dev] File Upload with more then 1 file upload fields
Hi guys ...
I tried uploading files with more then 1 file upload field.
But there seems to be no possibility to differ to files...
Is there only the possibility to get the File names with:
Enumeration files = cms.getRequestContext().getRequest().getFileNames();
??
the only thing would be if there is the first field empty the file name is
called unknown...
or is it also possible to get a file from a fileupload field which is
identified from the HTML 'name' attribute?
<input type="file" name="file1">
<input type="file" name="file2">
Thank you for any response...
Best Regards,
Nico
____________________________________
Nico Krause
NorthStar Communications GmbH
Wallbergstr. 20-22 85221 Dachau
Telefon: +49 (0) 81 31 / 9 96 87 - 53
Fax: +49 (0) 81 31 / 9 96 87 - 29
Mobil: +49 (0) 1 71 / 3 70 10 70
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20021213/08e9e8a1/attachment.htm>
More information about the opencms-dev
mailing list