URI는 그것이 텍스트의 한 페이지나, 비디오 또는 사운드 클립이든, 정지 화상이든 동영상이든, 또는 프로그램이든 상관없이, 이러한 콘텐츠 들 중 어느 하나를 인식하기 위한 수단이다. 가장 보편적인 형태의 URI가 바로, 웹페이지 주소 즉, URL인데, 이는 URI의 특별한 형태이자 부분집합이라 할 수 있다. URI는 대체로 다음과 같이 설명할 수 있다.
자원에 접근하기 위해 사용되는 절차 어떤 자원을 가지고 있는 특정한 컴퓨터 컴퓨터 상의 특정 자원의 이름 (파일 이름)
예를 들어 아래의 URI는 웹프로토콜 애플리케이션인 HTTP를 사용하여 액세스될 수 있는 파일을 인식하며, 그 파일은 유일한 인터넷 주소로 사상될 수 있는 www.w3.org라는 이름을 가진 컴퓨터에 존재한다.
http://www.w3.org/Icons/WWW/w3c_main.gif
컴퓨터의 디렉토리 구조에서, 그 파일은 "/Icons/WWW/w3c_main.gif"에 위치해 있다. FTP 주소와 전자우편 주소들을 인식하는 문자열들도 역시 URI이다 (그리고 HTTP 주소처럼, 이것들도 URL이라고 불리는 URI의 부분집합이다). URI의 또다른 종류 중 하나는 URN이다. URN은 "제도적인 영속성"을 갖는 URI의 한 형태로서, 그것의 정확한 위치는 때로 변할 수 있지만, 일부 에이전시가 그것을 찾을 수 있다는 것을 의미한다.
As web apps evolve, you might have found it handy to let users drag
and drop files from the desktop onto the browser to edit, upload, share,
etc. But unfortunately, we’ve been unable to drag and drop folders onto
web pages. Luckily, beginning with Chrome 21, this issue will be
addressed (already available in the Chrome dev channel).
Passing multiple files with drag and drop
Let’s look at a code sample of existing drag and drop.
<divid=”dropzone”></div>
var dropzone = document.getElementById('dropzone');
dropzone.ondrop = function(e) {
var length = e.dataTransfer.files.length;
for (var i = 0; i < length; i++) {
var file = e.dataTransfer.files[i];
... // do whatever you want
}
};
In this example, you can actually drag and drop
a file or files from the desktop to your browser, but when you try to
pass a folder, notice that it will be either rejected or treated as a File object resulting in a failure.
How to handle dropped folders
Chrome 21 allows you to drop a folder or multiple folders into the
browser window. To handle these, you need to change the way you handle
dropped objects.
<divid=”dropzone”></div>
var dropzone = document.getElementById('dropzone');
dropzone.ondrop = function(e) {
var length = e.dataTransfer.items.length;
for (var i = 0; i < length; i++) {
var entry = e.dataTransfer.items[i].webkitGetAsEntry();
if (entry.isFile) {
... // do whatever you want
} else if (entry.isDirectory) {
... // do whatever you want
}
}
};
Notice that a big difference here is that you can treat a dropped object as Entry (FileEntry or DirectoryEntry) by using new function called getAsEntry (webkitGetAsEntry).
After obtaining access to the Entry object, you can use
standard file handling methods that were introduced in the FileSystem
API specification. For example, this example shows how you can detect if
a dropped object is a file or a directory by examining the .isFile (or the .isDirectory) field.
For further information regarding the FileSystem API, read Exploring the FileSystem APIs, regarding new drag and drop capability, read this document. Of course, these features are open standards or are waiting to become one soon.
In a recent post, Eiji Kitamura highlighted a subtle, yet powerful new feature in the drag and drop APIs; the ability to drag in folders and retrieve them as HTML5 Filesystem API FileEntry and DirectoryEntry objects (done by accessing a new method on the DataTransferItem, .webkitGetAsEntry()).
What's remarkably cool about the .webkitGetAsEntry() extension is how elegant it makes importing files and entire folders. Once you have a FileEntry or DirectoryEntry from a drop event, it's a matter of using the Filesystem API's copyTo() to get it imported into your app.
An example of copying multiple dropped folders over to the filesystem:
var fs =null;// Cache filesystem for later.// Not shown: setup drag and drop event listeners.function onDrop(e){
e.preventDefault();
e.stopPropagation();var items = e.dataTransfer.items;for(var i =0, item; item = items[i];++i){var entry = item.webkitGetAsEntry();// Folder? Copy the DirectoryEntry over to our local filesystem.if(entry.isDirectory){
entry.copyTo(fs.root,null,function(copiedEntry){// ...}, onError);}}}
window.webkitRequestFileSystem(TEMPORARY,1024*1204,function(fileSystem){
fs = fileSystem;},function(e){
console.log('Error', e);});
Very nice! Again, the simplicity comes from integrating DnD with the Filesystem API calls.
Taking this one step further, we also have the ability to drag and drop a folder and/or files onto a normal <input type="file">, then access the entries as Filesystem directory or file entries. That is done through .webkitEntries:
<inputtype="file"multiple>
function onChange(e) {
e.stopPropagation();
e.preventDefault();
var entries = e.target.webkitEntries; // Get all dropped items as FS API entries.
[].forEach.call(entries, function(entry) {
// Copy the entry into our local filesystem.
entry.copyTo(fs.root, null, function(copiedEntry) {
...
}, onError);
});
}
document.querySelector('input[type="file"]').addEventListener('change', onChange);
I've put together a photo gallery demo to demonstrate these different techniques for importing files/folders.
Over 500 million people visit Facebook from a Mobile device
each month. Mobile apps that integrate with
Facebook provide a fundamentally better user experience.
Zend Framework 2 is an open source framework for developing web applications and services using PHP 5.3+. Zend Framework 2 uses 100% object-oriented code and utilises most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures.
RTSP는 월드와이드웹 상에서 스트리밍 데이터를 제어하는 방법에 대한 표준안이다. RTSP는 미국 컬럼비아 대학과 넷스케이프 및 RealNetworks 등에 의해 수행된 작업으로부터 비롯되었으며, 표준으로 지정 받기 위해 IETF에 제출되었다.
RTSP도 H.323과 마찬가지로, 멀티미디어 콘텐츠 패킷 포맷을 지정하기 위해 RTP를 사용한다. 그러나 H.323이 적당한 크기의 그룹간에 화상회의를 하기 위해 설계된 데 반해, RTSP는 대규모 그룹들에게 오디오 및 비디오 데이터를 효율적으로 브로드캐스트 하기 위한 목적으로 설계되었다.