Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



google/appengine/runtime/UnlinkUploads.php

Table of Contents
Copyright 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

\google\appengine\runtime\UnlinkUploads

Package: Default
Handles removing (unlink()) uploaded files that are left at tmp_name.

The shutdown hook is registered in Setup.php if $_FILES is not empty. Users are expected to use move_uploaded_file() to place wanted files in proper location.

If changes are made to the $_FILES array the shutdown hook will have an unmodified copy which both prevents tampering and allows empty files to be removed along with others after removeEmptyFiles() cleans the array.

GCS creates empty files when a POST request is sent with empty file fields. Typically PHP would ignore the file fields signified using UPLOAD_ERR_NO_FILE in the $_FILES array entry. Instead rfc1867.c is modified to pass the entries along with UNLINK as the file name to ensure the tmp_name is filled with gs:// address and can be unlinked along with any unprocessed uploads.

Constants

> V Constant NAME_UNLINK = '__UNLINK__'

Methods

method public removeEmptyFiles (array $files) : void
static

Remove empty file entries signified by __UNLINK__ from array.

Parameters
Name Type Description
$files array

Associative array of uploaded files ($_FILES).

method public shutdownHook (array $files) : void
static

Remove any left over uploads.

Parameters
Name Type Description
$files array

Associative array of uploaded files ($_FILES).

Documentation was generated by phpDocumentor 2.0.0a12 .