Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Aritra Ghosh
how to get the browsed file path into JSF controller-bean class?
7 de mayo de 2012 0:30
Respuesta

Aritra Ghosh

Ranking: Junior Member

Mensajes: 63

Fecha de incorporación: 8 de noviembre de 2011

Mensajes recientes

Hello,
I am using Icefaces fileEntry to upload file.I would like to save those browsed file to database instead of uploading them to server.So,how to get the browsed file path into JSF controller-bean class?I am using liferay 6.0.6 and Icefaces 2.Any help?
Thanks & regards,
Aritra Ghosh
David H Nebinger
RE: how to get the browsed file path into JSF controller-bean class?
7 de mayo de 2012 5:40
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 8378

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

Often times you cannot. The browser is not going to give you path information because that exposes too much information from the user's perspective.

All you get is the filename itself. Where you store it or how is up to you.
Aritra Ghosh
RE: how to get the browsed file path into JSF controller-bean class?
7 de mayo de 2012 6:18
Respuesta

Aritra Ghosh

Ranking: Junior Member

Mensajes: 63

Fecha de incorporación: 8 de noviembre de 2011

Mensajes recientes

Thanks David for your reply.So,if I want to store some file,I always need to upload it first,then to proceed further.Is it so?
David H Nebinger
RE: how to get the browsed file path into JSF controller-bean class?
7 de mayo de 2012 6:23
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 8378

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

No. Depends upon the framework you're using, but most of the time you'll get either a stream or the actual byte array of the upload, it's all in memory. You can push it to a file, push it to doc lib or image gallery, or store into a database.
Aritra Ghosh
RE: how to get the browsed file path into JSF controller-bean class?
7 de mayo de 2012 6:49
Respuesta

Aritra Ghosh

Ranking: Junior Member

Mensajes: 63

Fecha de incorporación: 8 de noviembre de 2011

Mensajes recientes

ohh..I am using icefaces 2 and using ace:fileEntry for uploading.Thus,FileEntryEvent is being used to sense the input file as
FileEntry fileEntry = (FileEntry)event.getSource();
FileEntryResults results = fileEntry.getResults();
Neil Griffin
RE: how to get the browsed file path into JSF controller-bean class?
8 de mayo de 2012 7:24
Respuesta

Neil Griffin

LIFERAY STAFF

Ranking: Liferay Legend

Mensajes: 2223

Fecha de incorporación: 26 de julio de 2005

Mensajes recientes

ace:fileEntry will save the file to a temporary location on the disk. After the upload finishes, you would need to call fileInfo.getFile() and then read the file and insert the bytes as a BLOB in the database.
Aritra Ghosh
RE: how to get the browsed file path into JSF controller-bean class?
9 de mayo de 2012 7:27
Respuesta

Aritra Ghosh

Ranking: Junior Member

Mensajes: 63

Fecha de incorporación: 8 de noviembre de 2011

Mensajes recientes

Thanks Neil for your reply.I did the same..emoticon
Sameer Srivastava
RE: how to get the browsed file path into JSF controller-bean class?
10 de septiembre de 2012 8:20
Respuesta

Sameer Srivastava

Ranking: New Member

Mensajes: 14

Fecha de incorporación: 22 de agosto de 2012

Mensajes recientes

Hello Aritra,

I am trying to do a similar but simpler thing.
The requirement is to read the file the file only and send it as part of the parameters to the web service URL.
I am unable to read the file though.
Although I could get the FileInfo for the file like file name etc. , but I am unable to read the file.
How did you manage to configure the temporary storage for the storage of file ?

Kindly share the detailed steps taken.
Thanks in advance emoticon

Regards,

sameer
Neil Griffin
RE: how to get the browsed file path into JSF controller-bean class?
11 de septiembre de 2012 9:33
Respuesta

Neil Griffin

LIFERAY STAFF

Ranking: Liferay Legend

Mensajes: 2223

Fecha de incorporación: 26 de julio de 2005

Mensajes recientes

When you call fileInfo.getFile() does it return a valid java.io.File instance pointing to the temporary file?
Sameer Srivastava
RE: how to get the browsed file path into JSF controller-bean class?
18 de septiembre de 2012 22:52
Respuesta

Sameer Srivastava

Ranking: New Member

Mensajes: 14

Fecha de incorporación: 22 de agosto de 2012

Mensajes recientes

Neil Griffin:
When you call fileInfo.getFile() does it return a valid java.io.File instance pointing to the temporary file?



Hello Neil,

thanks for your the reply.
I have posted all the details here .

Please help me.

Regards,
Sameer
Neil Griffin
RE: how to get the browsed file path into JSF controller-bean class?
19 de septiembre de 2012 9:23
Respuesta

Neil Griffin

LIFERAY STAFF

Ranking: Liferay Legend

Mensajes: 2223

Fecha de incorporación: 26 de julio de 2005

Mensajes recientes

Hi Sameer,

I was glad to see in the other post that you solved the problem.

Neil
Sameer Srivastava
RE: how to get the browsed file path into JSF controller-bean class?
17 de octubre de 2012 10:17
Respuesta

Sameer Srivastava

Ranking: New Member

Mensajes: 14

Fecha de incorporación: 22 de agosto de 2012

Mensajes recientes

Hey thanks Neil emoticon