2013-10-29 64 views

回答

0

好了,因爲我沒能找到解決這個問題,讓我做了什麼,我改變擴展形式.PPS爲.ppt等爲下

String sourceFileName = file.getName(); 
String mimeType =MimeTypesUtil.getContentType(file); 

    int index = sourceFileName.indexOf("."); 
    String extension = sourceFileName.substring(index); 
    String name = sourceFileName.substring(0 ,index); 

    if(extension.equalsIgnoreCase(".pps")){ 
     sourceFileName = name+".ppt"; 
    } 

    String title = "title name"; 
    String description="desc of video"; 
    String changeLog = StringPool.BLANK; 
    ServiceContext serviceContext = new ServiceContext(); 
    serviceContext.setAddCommunityPermissions(true); 
    serviceContext.setAddGuestPermissions(true); 
    serviceContext.setAddGroupPermissions(true); 

    DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName, mimeType, title, description, changeLog, file, serviceContext); 

後端,並且爲我工作的ABD產生預覽。我不知道這是否正確的方式,但它爲我工作。

+0

[same here](http://www.liferay.com/community/forums//message_boards/message/30822245)。 –