0

我正在使用 JDev 11g。我需要将文件上传到 Webcenter Content。我使用 RIDC API 上传文件,我可以成功上传。

问题是非英文字符显示已损坏。

是否有任何设置可以将文件名编码设置为 UTF8?

提前谢谢了!

更新:

文件名类似于:Avucunuzdaki Kelebek Full-split-[Part-1]-�_i��.mp4 in Webcenter Content。通常是 Avucunuzdaki Kelebek Full-split-[Part-1]-üğşiçö.mp4

当我在我的集​​成网络逻辑服务器上本地运行应用程序时,我可以上传具有正确文件名的文件。但在实时 Webcenter Portal 项目中,它会上传文件名已损坏的文件,如上所示。

奇怪的是,如果组件上传多个文件,就会发生这种情况。同一页面中还有一个 af:inputFile 组件,它可以成功上传非英文字符的文件。

您可以在下面看到我用来上传的代码:

RIDCAdaptor ridc = new RIDCAdaptor();

DataBinder db =
    ridc.checkinByUploadedPermanent(ufp, dosyaAdi, "DigitalMedia",
                                    "Secure");

ridc.createFileLinkInFolder(ridc.getFolderGUID("/Portal/Portal_Yonetim/Portal_Sunumlar"),
                            db.getLocal("dDocName"), "owner");


public RIDCAdaptor() {
    super();
    idcClientManager = new IdcClientManager();
    idcContext =
            new IdcContext(ProjectUtils.getAdminusername(), ProjectUtils.getAdminpassw());
    idcClient = createIdcClient();
}

public IdcClient createIdcClient() {
    IdcClient idcClient = null;
    try {
        idcClient =
                idcClientManager.createClient(ProjectUtils.getWCCIDCAddressWithPort());
    } catch (IdcClientException e) {
        e.printStackTrace();
    }
    idcClient.getConfig().setSocketTimeout(10000); // 30 secods
    idcClient.getConfig().setConnectionSize(20); // 20 connections
    return idcClient;
}

public DataBinder checkinByUploadedPermanent(UploadedFilePermanent uploadedFilePermanent,
                                             String docTitle,
                                             String docType,
                                             String securityGroup) {
    BlobDomain blobDomain = uploadedFilePermanent.getBlobDomain();
    DataBinder dataBinder = idcClient.createBinder();
    dataBinder.putLocal("IdcService", "CHECKIN_UNIVERSAL");
    dataBinder.putLocal("dDocType", docType);
    dataBinder.putLocal("dDocTitle", docTitle);
    dataBinder.putLocal("dDocAuthor", idcContext.getUser());
    dataBinder.putLocal("dDocAccount", "");
    dataBinder.putLocal("dSecurityGroup", securityGroup);
    dataBinder.putLocal("xClbraRoleList", ":authenticated(R)");
    dataBinder.addFile("primaryFile",
                       new TransferFile(blobDomain.getInputStream(),
                                        docTitle, blobDomain.getLength(),
                                        uploadedFilePermanent.getUploadedFile().getContentType()));
    ServiceResponse response = null;
    try {
        response = idcClient.sendRequest(idcContext, dataBinder);
    } catch (IdcClientException e) {
        e.printStackTrace();
    }

    DataBinder asBinder = null;
    try {
        asBinder = response.getResponseAsBinder();
    } catch (IdcClientException e) {
        e.printStackTrace();
    }

    return asBinder;
}
4

0 回答 0