cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload Problem

Former Member
0 Kudos

Hi,

I am trying to upload a file and it is not uploading. I ported the application in J2EE WAS SP7. If i port the application in j2ee+abap WAS SP7 ,the application is working fine. Why upload app is not working in j2ee based WAS?.Below is the code.

<i>

//@@begin onActionSubmit(ServerEvent)

String location = "c:
temp
";

//reingeschraubt!!!

// String fileName = "c:
temp
upload
" + wdContext.currentRootElement().getFileName();

String fileName = location + wdContext.currentRootElement().getFileName();

try{

File file = new File(fileName);

FileOutputStream out = new FileOutputStream(file);

IPrivateView1.IRootElement element = wdContext.currentRootElement();

out.write(element.getFile());

out.close();

}catch(Exception e){

throw new WDRuntimeException(e);

}

wdContext.currentRootElement().setFileName("");

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("File " + fileName + " wurde gesichert!");

//@@end

</i>

Thanks in Advance..

Regards

Vasu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

The File Upload component works fine on WAS with ABAP stack. It works on Java stack if there is some component installed(Dont know what the component name is). We have NWDS 2.0.8 and the WAS 6.40 with SP 8. But the code does not work. I also tried debugging the code and it doesnt seem to even enter the Action say onButtonClick.

But the same code works fine on the WAS with ABAP stack.I got this information from people at SAP TechEd. They told me that in order for the code to work on Java Stack some component needs to be there. I will try to get the exact details and let you know.

regards

Ravi

SandipAgarwalla
Active Contributor
0 Kudos

Hi,

We tried to upgrade the SAP Web AS 6.40 to SP8 for J2EE it works well, but still it has some problem in this.

When i make my portal on this it is not working. Can i know the exact reason.

Thankx & Regards

sandip

Former Member
0 Kudos

Hi .. all , for File Upload , i have an other problem . That is , in my company , we have two WAS servers ( 6.40 SP9 ) , one is installed on Window 2003 Exterprise , one is on AIX . With the same WebDynpro application deployed . A strange result happened , it works in the Window OS , but failed on AIX without any Exception captured . Until now i still can't find out where the problem is ... ><

Former Member
0 Kudos

Any Solutions?

Former Member
0 Kudos

Hello,

is really nobody out there who have any tips or suggestions to the File Upload Problem.

I see that there are a lot of people (me too) waiting for a functional demo of this UI Control like it was introduced in summer(?)

My Problem:

- method won't be called if a file was choosen

- there is some net traffic so data is transfered but there is no data in the binary context attribute after all

Former Member
0 Kudos

I finally found out the reason for the non-working FileUpload UI element:

The multipart-form is never parsed. To do so, you have to

start Visual Admin, then

go to "Cluster" tab/Server .../Services/Web Container,

then tab Properties,

then change MultipartBodyParameterName from "empty string" to "com.sap.servlet.multipart.body"

That has cost me a h.ll of a lot of time.

I hope it helps others to avoid that...

Holger.

Former Member
0 Kudos

Thanks a lot Holger.Now FileUpload is working fine...

Former Member
0 Kudos

Hi Holger :

I just want to say thanks a lot and i can upload files from client PC to KM repository through WebDynpro now ... _

Answers (3)

Answers (3)

Former Member
0 Kudos

Does anybody have any experinece with File Uploads in Web Dynpro and NetWeaver CE 7.1??

I am facing the following problem:

java.lang.IllegalArgumentException:

    at com.sap.tc.webdynpro.clientserver.data.DataContainer.createLocalPath(DataContainer.java:918)
    at com.sap.tc.webdynpro.clientserver.data.DataContainer.updateAttribute(DataContainer.java:347)
    at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.updateAttribute(AbstractAdapter.java:1324)
    at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.updateAttributeAsKey(AbstractAdapter.java:1010)
    at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FileUploadAdapter.onFILEUPLOADCHANGE(FileUploadAdapter.java:494)

The only thing I did is binding the resource property of the UI elemnt to a context element of type resource and yet, I keep receiving this exception...

Anybody?? I need help here! Thanks, Johannes

Former Member
0 Kudos

hi Holger,

you have mentioned all the steps for file uploading from web dynpro to KM.could u tell me something about how to upload file from web dynpro to SAP r/3.its very urgent.

thanx in advance.

thanx and regards,

pp

Former Member
0 Kudos

File upload works both on the standalone J2EE and on the ABAP+J2EE installation