locked
need help to upload file to healthvault through java sdk RRS feed

  • Question

  • I'm trying to upload file to health vault by using java sdk  but it not send the file content to health vault

    String fileName= FilenameUtils.getName(getFile().getFileName());
    		String content_Type= getFile().getContentType();
    				
    		File file= new File();
    		file.setName(fileName);
    		file.setSize(BigInteger.valueOf(getFile().getSize()));
    		
    		CodableValue codableValue=new CodableValue();
    		codableValue.setText(content_Type);
    		
    		file.setContentType(codableValue);
    		
    		Thing thing = new Thing();
        	thing.setData(file);
        	
        	PutThingsRequest ptRequest = new PutThingsRequest();
        	ptRequest.getThing().add(thing);
        	
        	OnlineRequestTemplate requestTemplate = new OnlineRequestTemplate();
        	Object obj = requestTemplate.makeRequest(ptRequest);
    can anyone help me please
    Tuesday, September 20, 2016 2:07 AM

All replies

  • I am not familiar with Java SDK. But for file upload, you actually need blob.

    Please refer to this MSDN article - https://msdn.microsoft.com/en-us/healthvault/dn783323


    Takashi Moriyama | Senior Program Manager | Microsoft Health

    Tuesday, September 27, 2016 6:53 PM