Uploading Media files from iPhone to server - iphone

I am developing an application which can upload Media files (Audio, Video, Image) to the server. I found out a way by using PHP server code we ware able to get the image in server and store it. I like to know what is the better way to upload a image to a server (SOAP or REST or using PHP).

Microsoft has an article on how to use DIME (Direct Internet Message Encapsulation)
IBM also has another way of sending soap attachments that seems a little older.

there are two way to upload the file using soap first is using base64_decode() and base64_encode() method
and anothere is using URL that is send by android (SOAP) php server..
code is
$tmpfile1 = './ABC.wmv'; (file from location)
$filename1 = 'video';
$handle1 = fopen($tmpfile, "r");(open in read mode)
$contents1 = fread($handle1, filesize($tmpfile1));
fclose($handle1);
$profile_video = base64_encode($contents); (and decode it)

Related

How to get serverside file uploading progress in Perfect

I'm trying to create a web page using Perfect(perfect.org), Where users will browse and upload files. Can anyone tell me how can I get the progress of file upload?
perfect.org-fileUploads
Refer above link and Do as-usual concept following in HTML-JS-PHP or HTML-JS-JSP or other programming
In other words
you can receive response status in percentage from server-side and display it to client or put loder while uploading the file
Thank you
Before an official solution released from PerfectlySoft Inc. for this feature request, you could try splitting the file into small pieces and upload them one by one, then merge them back to the server - since there is no such an industrial standard to apply, all other web servers either provide different solutions or simply stay away from it.

Visual studio unable to add swagger metadata file in my rest api client

I am new to mobile development. As i am familiar with c# .net so i am using xamarin plugin for visual studio. I have created a sample app in which i have used SQLite, created a DB and then performed CRUD operations. At this point all things are working good. But i already have a local DB and i want to use it. For this i have made an offline Azure api using swagger and on Release i have saved the files locally by using File System in release option in VS. Now i want to add my app as rest api client and want to use my local DB. But when i try to add as rest api client and then i select select an existing swagger file so while browsing i can't find any file. For reference please see the images bellow
So when i click browse and goto the location where i have saved my files for swagger i get nothing as shown in bellow image
Also it's finding the .json extension file which is not present in my publish api.
I don't know why it's happening, also as already told above i am new to mobile development i am not sure what to do. Kindly see the bellow image of my swagger UI
Any help would be highly appreciated
The URL you listed is for the user-friendly reference docs for your API; there should be a corresponding URL for the JSON definition endpoint for your API. Use this instead in the Add Rest API Client dialog in the "Swagger URL" option.
The other option is to use this peer URL to download the JSON description of your REST API into a local .json file and reference that when generating your client access classes.
For an example of these two endpoints, see https://msdn.microsoft.com/en-us/library/mt788315.aspx#Anchor_1.
Why you are using azure? I guess your are working in a company so they must have a server. Just publish your services on the server and then sync it with your mobile app and DB. This is the easiest and free way to do it. You can use Rest services for that

Parsing Contents of Dropbox File in JavaScript Web App

Is it possible using the Dropbox JS SDK to create a JavaScript web application that is able to parse the files in a user's Dropbox? In my use case, the user has some JSON files that I would like to parse and preview in the browser. Will the filesDownload(arg) method allow for this type of application, or is it only able to download the file to the user's machine?
The download methods, such as filesDownload and sharingGetSharedLinkFile return the file content directly as a Blob, as seen in the download example.
As long as you can use a Blob to do what you want, this should be possible.

SLIM API - Offer Files to Download

I am using Slim API for my Project. I want to offer Files for Download (Mostly PDF files). I found several Ways sending out a public link to the file, which i dont want. I also found an Middleware for the Version 2.4 of Slim, but I am using 3.x.
I just want to access the Route e.g. /downloads/version/2183
And the a Downlod with this certain File ID should start. I have a Path to the File on the Server in a variable available.
The Basic Idea behind is different restrictions, which user can download the file - but i can do that myself - the problem where I am stuck is, how to bring the Download over the Route to the Clients Browser
Does anyone know how to achieve this?
Cheers,
Niklas
This is actually very easy.
Set the Proper Headers for the file on the Response Object
Read the contents of the file into the body of the Response Object
$app->get('/my/file', function ($req, $res, $args) {
return $res->withHeader('Content-Type', 'application/octet-stream')
->withHeader('Content-Disposition', 'attachment')
->write(file_get_contents("file.txt"));
});

Send report to local printer from JasperReports Server through URL

I'm trying to call a report and send to local printer from a web app using JasperReports Server. There is a lot of documentation out there outlining output formats like PDF but I'm not finding anything on printing. I'm calling the report with url like
http://myhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&j_username=joeuser&j_password=joeuser&param=1&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Freports&reportUnit=%2Freports%2Fmyreport&output=pdf
This downloads a pdf, is there anyway to get this to send to local printer?
Thanks
This worked for me
w3m -dump_source "http://www.goo.com:8080/jasperserver/flow.html?_flowId=viewReportFlow&j_username=joeuser&j_password=joeuser&param=1&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Freports&reportUnit=%2Freports%2Fmyreport&output=pdf" | lpr