Fórumok

How to store file in table?

thumbnail
Bharamani P Tashildar, módosítva 8 év-val korábban

How to store file in table?

Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2014.08.27. Legújabb bejegyzések
Hi Liferay friends

Please Help me to store Files in table?

Thanks in advance
thumbnail
Raja Seth, módosítva 8 év-val korábban

RE: How to store file in table?

Regular Member Bejegyzések: 233 Csatlakozás dátuma: 2011.08.18. Legújabb bejegyzések
Bharamani P Tashildar:
Hi Liferay friends

Please Help me to store Files in table?

Thanks in advance



Hi Bharamani,

What is the use of storing files in table?

By default, Liferay stores documents and media files on the file system of the server on which it’s running.

Regards,
Raja
thumbnail
Manikantha Rajamani, módosítva 8 év-val korábban

RE: How to store file in table?

Expert Bejegyzések: 258 Csatlakozás dátuma: 2014.03.25. Legújabb bejegyzések
hi
use following property in portal-ext.properties

dl.store.impl=com.liferay.portlet.documentlibrary.store.DBStore


Regards
Manikantha R
thumbnail
Bharamani P Tashildar, módosítva 8 év-val korábban

RE: How to store file in table?

Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2014.08.27. Legújabb bejegyzések
Thanks for the reply,

i want to store file(or files) somwhere ,it may be default liferay table or custom table or server

How to achieve it?
thumbnail
Bharamani P Tashildar, módosítva 8 év-val korábban

RE: How to store file in table?

Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2014.08.27. Legújabb bejegyzések
Hi all ,

Can anybody give the idea to do this?

Thanks
thumbnail
Vishal Kumar, módosítva 8 év-val korábban

RE: How to store file in table?

Regular Member Bejegyzések: 198 Csatlakozás dátuma: 2012.12.12. Legújabb bejegyzések
You want code to do it?
thumbnail
Samuel Kong, módosítva 8 év-val korábban

RE: How to store file in table?

Liferay Legend Bejegyzések: 1902 Csatlakozás dátuma: 2008.03.10. Legújabb bejegyzések
Hi Bharamani

If you want to configure the Document and Media portlet to stores files in the database, then do as Manikantha suggested.

If you have your own files you want to store in the database, then (A) you posted in the wrong category and (B) this question isn't really specific to Liferay Portal. Just do a search on Google/Bing/etc. There's plenty of tutorials out there.

And if you just want to store the file on the server, just save the files to wherever you want . Also, not a Liferay Portal specific question. Plenty of tutorials out there on this also.
thumbnail
David H Nebinger, módosítva 8 év-val korábban

RE: How to store file in table?

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Moved to the right category.
thumbnail
Bharamani P Tashildar, módosítva 8 év-val korábban

RE: How to store file in table?

Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2014.08.27. Legújabb bejegyzések
Thanks For Reply

I Have One imp issue.........plz help me

<aui:input name="picture" type="file" label="Pictures"/>

In This Case We Use

UploadPortletRequest uploadPortletRequest = PortalUtil.getUploadPortletRequest(actionRequest);
File file = uploadPortletRequest.getFile("pictures");
InputStream fis = new FileInputStream(file);
OutputBlob dataOutputBlob = new OutputBlob(fis, file.length());

But for this Scenario
<aui:input name="pictures" type="file" label="Pictures" multiple="true"></aui:input>

How can i Use getFiles("Pictures");


Please Help Me.
Thank you
thumbnail
Himanshu Bhandari, módosítva 8 év-val korábban

RE: How to store file in table?

Regular Member Bejegyzések: 148 Csatlakozás dátuma: 2014.05.09. Legújabb bejegyzések
Hi

What do you mean by?
How can i Use getFiles("Pictures");


Well you will have file object after
File file = uploadPortletRequest.getFile("pictures");

above statement and you can apply methods or use it to pass as a parameter to methods.
HTH!
Thanks
thumbnail
Bharamani P Tashildar, módosítva 8 év-val korábban

RE: How to store file in table?

Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2014.08.27. Legújabb bejegyzések
Thanks for reply

See if i want to upload single file i use

File file = uploadPortletRequest.getFile("pictures");

and for multiple files i have to use

File file[]= uploadPortletRequest.getFiles("pictures");

so my problem How to use this...if any code snippet it would be better

Thanks
thumbnail
Olaf Kock, módosítva 8 év-val korábban

RE: How to store file in table?

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
I believe that sample code for file uploads in Liferay is the second most covered topic that you find on the internet, right after "how to change the logo or favicon". Did you already try google?

Also, "store a file in a table" is an invalid requirement: A file is part of a filesystem. When you upload binary data, you might want to store this somewhere, e.g. in a file or in a database. As you don't give any information about the content/nature of the data or the table structure that you demand, I'd really suggest that you upload to the Document Library. Your problem would immediately be solved - done.
thumbnail
Himanshu Bhandari, módosítva 8 év-val korábban

RE: How to store file in table?

Regular Member Bejegyzések: 148 Csatlakozás dátuma: 2014.05.09. Legújabb bejegyzések
Hi

You have for loop for that.emoticon
Thanks