Using Resource type in Netweaver 7.1 for file upload
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();
Did you check [this|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71] one?