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();