partial.js logo
Latest version
v1.3.1 (RC2)

HttpFile


This class is created after is uploaded a file on the server. Using: Controller.files.

Properties


file.contentType {String}file.filename {String}file.height {Number}file.length {Number}file.name {String}file.path {String}file.width {Number}
file.contentType;
return String;

Content type of uploaded file.

file.filename;
return String;

Filename of uploaded file.

file.height;
return Number;

Image height of uploaded file.

file.length;
return Number;

File length of uploaded file.

file.name;
return String;

Field name.

file.path;
return String;

Path to filename (temporary directory)

file.width;
return Number;

Image width of uploaded file.

Methods


file.copy(filename, [callback])file.image([imageMagick])file.isAudio()file.isImage()file.isVideo()file.md5(callback)file.pipe(stream, [options])file.read(callback)file.readSync()file.stream([options])
file.copy(filename, [callback]);
return HttpFile;

Copy file to new filename.

file.image([imageMagick]);

Get FrameworkImage object.

file.isAudio();
return Boolean;

Return true if the file is audio.

file.isImage();
return Boolean;

Return true if the file is image/picture.

file.isVideo();
return Boolean;

Return true if the file is video.

file.md5(callback);
return HttpFile;

Get MD5 sum.

file.pipe(stream, [options]);
return HttpFile;

Pipe stream to stream.

file.read(callback);
return HttpFile;

Read file.

file.readSync();
return Buffer;

Read file (sync)

file.stream([options]);
return HttpFile;

Get file readable stream.