Foros de discusión

file uploaded by ace:fileEntry chrome add's "-" to file extension

thumbnail
Fateh Alchhabi, modificado hace 11 años.

file uploaded by ace:fileEntry chrome add's "-" to file extension

Junior Member Mensajes: 58 Fecha de incorporación: 1/12/10 Mensajes recientes
Hi all
i programmed Icefaces Portlet and it's store Files in document library and do same job like the demo icefaces portlet "icefaces3-documents-portlet-3.0.0-ga1"

but i notice that;s the store works fine but if i want to download the file in "google chrome" the chrome add's dash "-" to the end of the File
but on other explorers (IE ,FireFox) it downloaded fine this happend even in the Demo icefaces portlet

ps.
*the File Link in WebDAV URL is http://localhost:8080/tunnel-web/secure/webdav/test/document_library/Koala.jpg
*Chrome Version 23.0.1271.97 m
*Liferay liferay-portal-6.0-ee-sp2

so any soulation for this problem ??
thumbnail
Neil Griffin, modificado hace 11 años.

RE: ICEFaces Portlet Storing in document library (Respuesta)

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Liferay Faces Bridge has a class named RequestParameterMapMultiPartImpl.java that contains the following code:

	protected String stripIllegalCharacters(String fileName) {

		// [url=http://issues.liferay.com/browse/FACES-64]FACES-64[/url]: Need to strip out invalid characters.
		// http://technet.microsoft.com/en-us/library/cc956689.aspx
		String strippedFileName = fileName;

		if (fileName != null) {
			strippedFileName = fileName.replaceAll("[\\\\/\\[\\]:|<>+;=.?\"]", "-");
		}

		return strippedFileName;
	}


My best guess is that the version of Chrome you are using has a bug such that it appends an invalid character at the end of the filename during upload.

As a workaround, you could simply trim-off the dash character in your file upload handler.
thumbnail
Fateh Alchhabi, modificado hace 11 años.

RE: file uploaded by ace:fileEntry chrome add's "-" to file extension

Junior Member Mensajes: 58 Fecha de incorporación: 1/12/10 Mensajes recientes
Thanks Neil you are Genius
with you JSF & portlets it's more Nice and fun
you Mr.Neil & james gosling my inspires in my Life thanks alto