Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Download file and save in MAF project

3151744Feb 9 2017

Hi MAF experts,

I have a download function in a MAF project.

This function will download a pdf file from a http url, and save it in mobile directory.

Now I implemented it in Android mobile, but when goes to iphone, this function is failed.

I attached part of the program below which is used for checking the type of operation system, and indicate the directory for saving download file.

As you see if it is a iPhone, I will indicate the directory as "/tmp/mcs.pdf";

May I ask if the format of directory is correct or if any directory I should use for saving download file in iPhone.

  if (DeviceManagerFactory.getDeviceManager().getOs().equalsIgnoreCase("IOS")==true) {

                    savedFilePath = "/tmp/mcs.pdf";

                } else {

                    savedFilePath = "/sdcard/mcs.pdf";

                }

                FileOutputStream outfile = new FileOutputStream(savedFilePath);

                outfile.write(byStream.toByteArray());

                outfile.close();

Comments
Post Details
Added on Feb 9 2017
0 comments
236 views