Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Using Resource type in Netweaver 7.1 for file upload

Dear All,

I want to check the file extension and file size before uploading it through a file upload UI element in Web Dynpro 7.1.

How to go about it? And I am using following code for image upload. Is it correct one?

IWDResource photoData = wdContext.nodePhotos().getPhotosElementAt(i).getPhotoData();

FtpURLConnection myConnection = new FtpURLConnection(myUrl);		

myConnection.connect();				
OutputStream out = myConnection.getOutputStream();			
		
int temp = 0;
InputStream text = photoData.read(false);

while((temp=text.read())!=-1)
        out.write(temp); 
										
out.flush();
out.close();
myConnection.close();		      

Kindly help.

Regards,

Amey Mogare

replied

Did you check [this|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71] one?

Bala

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question