Over Air File Transfer Function

Source: Internet
Author: User
Tags password protection

Q:

More and more programs provide in-app wireless connection to the file transfer function in the LAN. The most common thing is to upload files through a web page and upload controls; in fact, it is not difficult for people who have been using the Linux kernel to understand some Browser/webserver knowledge.

Copy from/to over air: Very cool word over air

 

In applications like 'simple PDF Reader 'you flick a switch in the app and are provided with an IP address and port number. you then enter these details into a computer browser on the same wireless network and can then get to a Web page hosted by the device.
This real world example allows copy of PDF files to and from that device's app

Sample instance:

Host your website from Apple iPadNginxFor IOS

A great news for iPad users. from now if you want to host your website from your iPad it's possible. in other words you can develop PHP Web apps on your Apple iPad. jordan (aka greysyntax) has compiled and rebuild nginx with zlib (lightweight but powerful Webserver
For Linux & UNIX system) to run on Apple IOS.
 

The nginx package for iOS comes with SSL and gzip support enough to power up small website. an important point to be noted here is that Apple iPad doesn' t have horsepower to run full fledged website or php web app, but this is actually the real excitement
To see what this magical device can show its magic in here.

======================================

A simple HTTP Server

→ Download xcode project: Under IOS sample file folder

What it is
 
The xcode project of a simple web server. it demonstrates how to use nsfilehandle, nssocketport, and cocoa specifications to write a simple server application. core Foundation functions are used to create and parse HTTP messages. it also shows how to replace
Nssocketport with native unix cils.

What it does
 
Simplehttpserver listens to port 50000, uses the path of the request-URL to construct a new URL by inserting "http: //" at the beginning, loads this new URL and renders its contents to a PDF file. the PDF file is returned to the client .......
Renders its contents to a PDF file ...... just as reading PDF?

How to use it
 
With simplehttpserver runnning, open safari 2.0 and type, for example, "http: // localhost: 50000/www.apple.com ". both the IP address of the connecting client as well as the path of the request-URL are picked
Up by simplehttpserver, and the corresponding page is loaded into a Web View. once the web page is converted to PDF, the PDF data is sent back to Safari where it is displayed inside the browser window.

 

======================================

Cocoahttpserver

Https://github.com/robbiehanson/CocoaHTTPServer/wiki

Cocoahttpserver is a small, lightweight, embeddable HTTP server for Mac OS X or IOS applications.

Sometimes developers need an embedded HTTP server in their app. perhaps it's a server application with remote monitoring. or perhaps it's a desktop application using HTTP for the communication backend. or perhaps it's an iOS app providing over-the-air access
To documents. Whatever your reason, cocoahttpserver can get the job done. It provides:

  • Built in support for bonjour Broadcasting
  • IPv4 and IPv6 support
  • Asynchronous networking using GCD and standard sockets
  • Password protection support
  • SSL/TLS encryption support
  • Extremely fast and memory efficient
  • Extremely scalable (built entirely upon gcd)
  • Heavily commented code
  • Very easily extensible
  • WebDAV is supported too!

The next step is to study web pages and file writing.

 

 

Cocoahttpserver implements multipart/form-data upload form

 

Source code: Webserver

Http: // GitHub/willonboy

Additional Appendix: cocoahttpserver official example project source code: cocoahttpserver (Official example)

Cocoahttpserver is really great, not only supports get, post, put, delete, header, but also supports redirect, authentication request, websocket, simple dynamic web page (httpdynamicfileresponse )!

The code inside is worth further research!

 

Let the iPhone become a webserver, upload files, and read. The WebDAV server is based on cocoahttpserver.

 

====================

Http://sourceforge.net/scm? Type = SVN & group_id = 253777 & source = navbar

MP4 videos, images, and PDF files can be opened normally.

The program code can be

The so-called bonjour address: similar to XXX. hostname: 8090. In Windows, it is called Bois name/NT name.

Bonjour Service published: domain (local.) type (_ HTTP. _ TCP.) name (Admin's MacBook

Others:
There are similar programs for sale in the app store. I bought 2 on my own,1 ifileFor money, there is also a fileslite for free. Because the iPhone cannot be directly used as a USB storage device, this kind of program was born. But most of the principles are the same. Let the iPhone become a webserver, then upload files, and then read them. WebDAV server is based on cocoahttpserver, an open yuan code, can be found from googlecode: http://code.google.com/p/cocoahttpserver/

Added a message indicating that itune can be used for file sharing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.