cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading empty Software

Former Member
0 Kudos

Hi Colleagues,

We have developed an application which is used to download softwares from SMP (service market place).we have used a servlet to downlaod the software. When i click on download button of my implemented application, a new window with three options "Open", "Save" and "Close" .

When we select "Save", the software gets saved with extenssion ".exe". But when we run the software it is empty.

But if try directly downlaoding the software , it is also storing as an exe file. But i am able to INSTALL that Spftware.

When i checked the properties of the exe from the SMP it is showing as the file description is "SAP Self-Extractor MFC Application".

Could any one please let me know what are code changes that are required in my below code to download a exe file of type "SAP Self-Extractor MFC Application".

Code used to downlaod software in my application:


           
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();      
            
            connection.setRequestProperty("Authorization" , encodedData);            
            connection.connect();
            

            if (connection.getResponseCode() == 200)
            {
            	response.setStatus(connection.getResponseCode());
            	response.setContentType("application/zip");
            	response.addHeader("Content-Disposition", "attachment;filename=" + file );            	
            	BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
            	//servout.println("new");         
				InputStream inp = connection.getInputStream();
				
			     byte[] buf = new byte[4 * 1024]; // 4K buffer
			     int bytesRead;
			     while ((bytesRead = inp.read(buf)) != -1) 
			     {
			    	 out.write(buf, 0, bytesRead);
			    }               
            }                       
		 

Please help me here

Many Thanks

Best Regards

Swetha

Accepted Solutions (0)

Answers (1)

Answers (1)

chintan_virani
Active Contributor
0 Kudos

What is need for an application when SAP Download Manager can do the job for you...

Chintan

Former Member
0 Kudos

Hi Chintan,

This is an application.......where all the softwares required are available.....there might be some user who doesn't have access to directly download the software (its a requirement for us....to develop an application ).

Thanks & Regards

Swetha.

chintan_virani
Active Contributor
0 Kudos

You require a valid S-User id to be able to download softwares from SMP else it will give you error.

Chintan

Former Member
0 Kudos

Hi Chintan,

I have already provided S-User details and i am able downlaod the software........But after downloading...the software is empty......

Here i feel the empty software is due to the Code while downloading the software.It needs some additional code to be inserted to get a file of typ "SAP Self-Extractor MFC Application".

Could you please let me know if you are aware of something like this.

Thanks & Regards

Swetha