cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Problems uploading files in Windchill 6.2.6

ptc-2083384
1-Newbie

Problems uploading files in Windchill 6.2.6

Hi all,

I manage a Windchill 6.2.6 application for a customer. When an user uploads a file as a primary or secondary content, sometimes (but not always) the file is corrupted after the upload and is not readable. For example, he takes a pdf, tiff or dwg file, that is correctly readable, uploads it into Windchill, and it seems that the system creates the document correctly, but when any other user downloads the file, it becomes not readable. I tried to find the cause of this issue, and I verified that the problem is not dependent on the file type, the file size or the reader version (Acrobat Reader, Autocad, etc). Neither the MethodServer.log nor the Oracle log keep any error trace.

I read in some internet forum that it could be caused by the JRE version. Unfortunately Windchill 6.2.6 had the 1.3.1_08 version, while the actual systems use the 1.6.0 version, release over 20, but the last release i found compatible with Windchill 6.2.6 is 1.6.0_07. Anyway, I can't understand why some files are uploaded correctly and other files aren't.

Does someone have any idea?

Thanks in advance.

Best regards,

LAURA

4 REPLIES 4
ansasik
4-Participant
(To:ptc-2083384)

in 6.2.6, i have faced an issue with the naming convention of files, for eg. if there r special chars like : in the name, it will get uploaded, but when the page is accssed, it will generate a null pointer exception. Is this a similar behavior?

Hi Anoop,

I have also experienced the issue you described. Is another kind of problem. You could solve it in two steps:

1. Add a javascript function to all html templates that use the upload applet. This function controls the file name before uploading it and, if finds any special character, alerts you and blocks the execution of the upload. I can suggest you this example:

function hasInvalidCharacters(sText) {

var ValidChars = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm0123456789.-_ "

var hasInvalidChars = false;

var sChar;

var lastIndex;

lastIndex = sText.lastIndexOf('\\');

sText = sText.substring(lastIndex+1);

for (i = 0; i < sText.length && hasInvalidChars == false; i++) {

sChar = sText.charAt(i);

if (ValidChars.indexOf(sChar) == -1) {

hasInvalidChars = true;

//alert("Special Character: " + Char);

}

}

return hasInvalidChars;

}

function changedFile() {

if (!hasInvalidCharacters(document.documentForm.primaryFile.value)) {

if ( document.documentForm.primaryFile.value.length > 0 ) {

document.documentForm.rememberedFile.value = document.documentForm.primaryFile.value;

document.documentForm.File.value = document.documentForm.primaryFile.value;

}

document.documentForm.targetType.value = "FILE";

}

else {

alert("You can not use special characters for file naming. Please modify the name before saving the document.");

document.documentForm.primaryFile.value = document.documentForm.rememberedFile.value;

document.documentForm.rememberedFile.value = "";

return;

}

}

2. Make an update query directly on the database, in the APPLICATIONDATA table, to edit the field FILENAME and rename the file reference avoiding any special cheracter. For example:

update applicationdata d

set d.FILENAME = replace(d.FILENAME,'à','a')

where instr(d.FILENAME,'à') > 0;

update applicationdata d

set d.FILENAME = replace(replace(d.FILENAME,'%20',' '),'%','percent')

where instr(d.FILENAME,'%') > 0;

My problem is on the file content, not on the file name. After the upload, you can download it, but when you open the file is not readable.

Regards,

LAURA

ansasik
4-Participant
(To:ptc-2083384)

I usually use the second option- update applicationdata table.About the issue you are having - is it isolated to only a single machine? maybe workstation related. Is the uploader himself able to download the file after uploading? Were you able to reproduce the issue using the app admin id? Maybe you have tried all these options, but just some thoughts..

Hi Anoop,

We noted that the issue could be server side. We have a test environment that works correctly using the same files that create problems in production environment. But the test environment is all in one machine (web server, application server and database server are installed on the same hardware) while the production environment has four machines in load balancing as web server, two machines as application server clustered and two machines as database server clustered.

The uploader is not able to download the file uploades, neither with normal users nor admin user.

Thanks for triyng to help me

Regards,

LAURA

Top Tags