Closed cutmaster closed 12 years ago
I had the same problem, so to handle it i wrote a small function in javascript to crop the length of the filename.
function truncate(objFilename) {
/*IE returns the full file path, where ff does not, so check for slashes */
if (objFilename.indexOf("\\") != -1) {
var path_arr = objFilename.split("\\");
objFilename = path_arr[path_arr.length - 1];
}
var arr = objFilename.split('.');
if (arr[0].length > 30) { objFilename = arr[0].slice(0, 29) + "." + arr[1]; } return objFilename;
}
You need to wrap the function around where the filename is shown inside the function associated with buildUploadRow:
I tried and tried, but I don't even know where to put the code :( Instead of using JS, I would advise you to use CSS to fix this issue, e.g.: Perfekt, thx! :D
That should be implemented^^
return $('
<\/td>' +
truncate(files[index].name)
It will only shorten the filenames visually, thus reducing the horrid breaking of the container. Images/Files that are sent to the server will retain their long names. Hope this helps ;-).files .name {
max-width: 200px;
word-wrap: break-word;
}
If someone upload a file named : blabla_blibli_bloblo_blublu_aaaaaaaa_bbbbbbbbb_ccccccccc_dddddddddddd_eeeeeeeeee.jpg the div goes outside its container and sometimes it is not possible to see the download button nor the progress bar Is there a way to auto-reduce the {name} tag ? (I've tried on the upload.php program but it seems to not work for the two divs before having finished the upload).