-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4561106
By: hlezmana
hi,
Wondering if anyone can help me customizing fileupload so that the upload button says "Some text" rather than "Upload". In addition, I need the fileupload dialog window to accept only excel files.
I am trying to create a window that takes 2 excel files, then perform some calculation on the 2 excel files which then produces another excel file (in the form of file download). So essentially speaking combining the fileupload component and filedownload component to one single button. Is that doable?
Is it possible to mimic the Fileupload component using a regular button and a couple <input> elements? I was looking at the UploadEvent but couldn't figure out how i could fire that off manually. In addition i don't know how to construct the underlying media object from a filepath.
Any suggestion?
Thanks,
Akin
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4561438
By: jebberwocky
Dear Akin
To contruct a media object from a filepath:
java.io.InputStream is = desktop.getWebApp().getResourceAsStream("/me.pdf");
Media = new AMedia(FILE_NAME, null, "application/pdf", is)
for the AMedia's constructor, please refer to zcommons javadoc http://www.zkoss.org/javadoc/3.0.0-RC/zcommon/
//Jeff
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4561543
By: sousa1981
"Wondering if anyone can help me customizing fileupload so that the upload button says "Some text" rather than "Upload". In addition, I need the fileupload dialog window to accept only excel files."
Try:
Fileupload fu = new Fileupload();
fu.setTemplate("/zul/fileupload.zul");
Media[] aux_ficheiros = fu.get("only excel", "my App", MAX_FILEUPLOAD_SIZE); if (aux_ficheiros != null) {
for (int i = 0; i < aux_ficheiros.length; ++i) {
if (isAllowed_extensions(getExtension(aux_ficheiros[i].getName())) {
// Process File
}
}
}
Where "/zul/fileupload.zul" is an template that you copied from ZK Src file and modified the test "Upload" to "Some text" and that template is in your WebRoot "/zul/fileupload.zul"
Hope this help,
Marcos de Sousa
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4561980
By: hlezmana
Thanks so much, i'll try those.
I am still having trouble looking up the template file "/zul/fileupload.zul".
I browsed most of the folders in SVN. Couldn't find a file named fileupload.zul.
Akin
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4562034
By: sousa1981
On the SRC "zk-src-3.0.0-FL-2007-09-28"
Go to:\zk-src-3.0.0-FL-2007-09-28\zul\src\archive\web\zul\html
There is an fileuploaddlg.zul or something related.
Remember that the modification of fileupload will not working if u change version of zk.
To work, u must update the template according the version of zk (go to src and get the template version).
I use the fileupload.zul template, because I wanted to customize the template in size, height on version 2.4.1, in version 3, maybe it had been corrected, and I haven't an fileupload on version 3 in production.
Regards,
Marcos de Sousa
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4562040
By: sousa1981
You will have success, if you in addition, read the documentation (see the javadoc and pdf) about upload and download.
Because my information maybe be incorrect.
Regards,
Marcos de Sousa
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4562154
By: hlezmana
Thanks again Marcos,
the fileuploaddlg.zul uses fileuploaddlg.dsp.
the following line seems to be the line that i need to change in fileuploaddlg.dsp:
<input type="submit" value="${c:l('mesg:org.zkoss.zul.mesg.MZul:UPLOAD_SUBMIT')}"
onclick="parent.zk.progress()"/>
Is there any tutorial on modifying/building/deploying/maintaining such DSP file?
Akin
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4563213
By: sousa1981
You dont need to modify the DSP file, read the documentation how to customize the fileupload.
Regards,
Marcos de Sousa
dear all:
I have a question.
how to get "ture file" into my customize's folder space.
ex:
client upload a file [name=hello.xls] into this folder↓
C:\upload
how can i get file in C:\upload
if use Reader , i got Error message : use getByteData() instead .
please help me
uh... first I'm not sure if this problem is a ZK problem.
But anyway, it's no really a big deal, the real problem is: Second, this is a very old post which seems has no relation to your problem, you should shoot a new post.
Asked: 2007-10-09 23:14:30 +0800
Seen: 2,371 times
Last updated: Mar 21 '10