-
Notifications
You must be signed in to change notification settings - Fork 33
Home
Huey Ly edited this page Aug 11, 2017
·
5 revisions
Class representing a filestack filelink object
Visibility | Function |
---|---|
public |
__construct(string $handle, string $api_key='' , mixed $security=null, mixed $http_client=null) : voidFilelink constructor |
public |
ascii(string $background='white' , bool $colored=false, string $foreground='red' , bool $reverse=false, mixed $size=100) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include ascii task can be the word for a color hex value e.g. ('black' or '000000') if set to true. Only works in non-colored mode. the ASCII output. Requires colored:true. |
public |
blackWhite(int $threshold=50) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include blackwhite task (contrast) in the returned image. This parameter accepts integers between 1 and 100. The lower the number the less black appears in the picture. |
public |
blur(int $amount=2) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include blur task parameter can be any integer in a range from 1 to 20. |
public |
border(string $background='white' , string $color='black' , int $width=2) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include border task the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') around the image. The value for this parameter must be in a range from 1 to 1000. |
public |
circle(string $background='black' ) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the circle task the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') |
public |
collage(array $files, int $width, int $height, string $color='white' , string $fit='auto' , int $margin=10, bool $auto_rotate=false) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the collage task urls. These are the images that will comprise the other images in the collage. The order in which they appear in the array dictates how the images will be arranged. word or hex value, e.g. ('red' or 'FF0000') images in the collage are manipulated so that the final collage image will match the height and width parameters you set more closely. Crop will produce a result that is closest to the height and width parameters you set. the images. Range is 1 to 100. rotates all the images in the collage according to their exif orientation data. |
public |
compress(bool $metadata=false) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the compress task metadata out of the image to reduce the file size. If you need to maintain the file metadata, you can set this to true in order to prevent the metadata from being removed. |
public |
convertAudio(string $format, array $options=array(), bool $force=false) : string (uuid of conversion task) Convert this filelink to another audio format. You can setup webhooks to notify you when the transcoding has completed. See our online documentation for more details: https://www.filestack.com/docs/audio-transformations convert to. e.g (aac, hls, mp3, m4a, oga) access: public or private Indicates that the file should be stored in a way that allows public access going directly to the underlying file store. For instance, if the file is stored on S3, this will allow the S3 url to be used directly. This has no impact on the ability of users to read from the Filestack file URL. Defaults to 'private'. audio_bitrate: Sets the audio bitrate for the audio file that is generated by the transcoding process. Must be an integer between 0 and 999. audio_channels: Set the number of audio channels for the audio file that is generated by the transcoding process. Can be an integer between 1 and 12. Default is same as source audio. audio_sample_rate: Set the audio sample rate for the audio file that is generated by the transcoding process. Can be an integer between 0 and 99999. Default is 44100. clip_length: Set the length of the audio file that is generated by the transcoding process. Format is hours:minutes:seconds e.g. (00:00:20) clip_offset: Set the point to begin the audio clip from. For example, clip_offset:00:00:10 will start the audio transcode 10 seconds into the source audio file. Format is hours:minutes:seconds, e.g. (00:00:10) container: The bucket or container in the specified file store where the file should end up. extname: Set the file extension for the audio file that is generated by the transcoding process, e.g. ('.mp4', '.webm') filename: Set the filename of the audio file that is generated by the transcoding process. location: The custom storage service to store the converted file to, options incude 'S3', 'azure', 'gcs', 'rackspace', and 'dropbox' path: The path to store the file at within the specified file store. For S3, this is the key where the file will be stored at. By default, Filestack stores the file at the root at a unique id, followed by an underscore, followed by the filename, for example "3AB239102DB_myaudio.mp3" title: Set the title in the file metadata. or pending audio encoding if a transcoding fails, and you make the same request again |
public |
convertFile(string $filetype, array $options=array()) : \Filestack\Filestack/Filelink Convert this filelink to another file format. To see which formats can be converted, see: https://www.filestack.com/docs/image-transformations/conversion convert the file. e.g (doc, docx, html, jpg, ods, odt, pdf, png, svg, txt, webp) background: Set a background color when converting transparent .png files into other file types. Can be a word or hex value, e.g. ('white' or 'FFFFFF') colorspace: RGB, CMYK or Input By default we convert all the images to the RGB color model in order to be web friendly. However, we have added an option to preserve the original colorspace. This will work for JPEGs and TIFFs. compress: (bool) You can take advantage of Filestack's image compression which utilizes JPEGtran and OptiPNG. Value for this parameter is boolean. If you want to compress your image then the value should be true. Compression is off/false by default. density: (int, 1 to 500). You can adjust the density when converting documents like PowerPoint, PDF, AI and EPS files to image formats like JPG or PNG. This can improve the resolution of the output image. docinfo: (bool) Set this to true to get information about a document, such as the number of pages and the dimensions of the file. page: (int, 1 to 10000) If you are converting a file that contains multiple pages such as PDF or powerpoint file, you can extract a specific page using the page parameter. pageformat: set the page size used for the layout of the resultant document. This parameter can be used when converting the format of one document into PDF, PNG, or JPG. Possible values: 'A3', 'A4', 'A5', 'B4','B5', 'letter', 'legal', 'tabloid' pageorientation: portrait or landscape determine the orientation of the resulting document. This parameter can be used when converting the format of one document into PDF, PNG, or JPG. quality: (int, 1 to 100, or 'input') You can change the quality (and reduce the file size) of JPEG images by using the quality parameter. The quality is set to 100 by default. A quality setting of 80 provides a nice balance between file size reduction and image quality. If the quality is instead set to "input" the image will not be recompressed and the input compression level of the jpg will be used. secure: (bool) This parameter applies to conversions of HTML and SVG sources. When the secure parameter is set to true, the HTML or SVG file will be stripped of any insecure tags (HTML sanitization). Default setting is false. strip: (bool) Set to true to remove any metadata embedded in an image. |
public |
convertVideo(string $format, array $options=array(), bool $force=false) : string (uuid of conversion task) Convert this filelink to another video format. You can setup webhooks to notify you when the transcoding has completed. See our online documentation for more details: https://www.filestack.com/docs/video-transformations convert to. e.g (aac, h264, h264.hi, hls.variant, hls.variant.audio, m4a, mp3, oga, ogg, ogg.hi, webm, webm.hi) access: public or private Indicates that the file should be stored in a way that allows public access going directly to the underlying file store. For instance, if the file is stored on S3, this will allow the S3 url to be used directly. This has no impact on the ability of users to read from the Filestack file URL. Defaults to 'private'. aspect_mode: set the aspect mode (default: letterbox) 'preserve` - Original size and ratio is preserved. 'constrain' - Aspect ratio is maintained, No black bars are added to the output. 'crop' - Fills frame size and crops the rest 'letterbox' - Adds black bars to defined height 'pad' - Adds black bars to output to match defined frame size audio_bitrate: Sets the audio bitrate for the audio file that is generated by the transcoding process. Must be an integer between 0 and 999. audio_channels: Set the number of audio channels for the audio file that is generated by the transcoding process. Can be an integer between 1 and 12. Default is same as source audio. audio_sample_rate: Set the audio sample rate for the audio file that is generated by the transcoding process. Can be an integer between 0 and 99999. Default is 44100. clip_length: Set the length of the video file that is generated by the transcoding process. Format is hours:minutes:seconds e.g. (00:00:20) clip_offset: Set the point to begin the video clip from. For example, clip_offset:00:00:10 will start the audio transcode 10 seconds into the source audio file. Format is hours:minutes:seconds, e.g. (00:00:10) container: The bucket or container in the specified file store where the file should end up. extname: Set the file extension for the audio file that is generated by the transcoding process, e.g. ('.mp4', '.webm') fps: Specify the frames per second of the video that is generated by the transcoding process. Must be an integer between 1 and 300 Default is to copy the original fps of the source file. filename: Set the filename of the audio file that is generated by the transcoding process. keyframe_interval: Adds a key frame every 250 frames to the video that is generated by the transcoding process. Default is 250. location: The custom storage service to store the converted file to, options incude 'S3', 'azure', 'gcs', 'rackspace', and 'dropbox' path: The path to store the file at within the specified file store. For S3, this is the key where the file will be stored at. By default, Filestack stores the file at the root at a unique id, followed by an underscore, followed by the filename, for example "3AB239102DB_myaudio.mp3" title: Set the title in the file metadata. two_pass: Specify that the transcoding process should do two passes to improve video quality. Defaults to false. width: Set the width in pixels of the video that is generated by the transcoding process. height: Set the height in pixels of the video that is generated by the transcoding process. upscale: Upscale the video resolution to match your profile. Defaults to true. video_bitrate: Specify the video bitrate for the video that is generated by the transcoding process. Must be an integer between 1 and 5000. watermark_bottom: The distance from the bottom of the video frame to place the watermark on the video. (0 to 9999) watermark_left: The distance from the left side of the video frame to place the watermark on the video. (0 to 9999) watermark_right: The distance from the left side of the video frame to place the watermark on the video. (0 to 9999) watermark_left: The distance from the top of the video frame to place the watermark on the video. (0 to 9999) watermark_width: Resize the width of the watermark watermark_height: Resize the height of the watermark watermark_url: The Filestack handle or URL of the image file to use as a watermark on the transcoded video. or pending audio encoding if a transcoding fails, and you make the same request again |
public |
crop(int $x_coordinate, int $y_coordinate, int $width, int $height) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include crop task |
public |
debug() : json object Set this Filelink's transform_url to include the detect_faces task |
public |
delete() : bool (true = delete success, false = failed) Delete this filelink from cloud storage |
public |
detectFaces(string $color='dimgray' , bool $export=false, mixed $min_size=0.35, mixed $max_size=0.35) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the detect_faces task boxes and text. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') that most likely are not faces. This can be an integer or a float in a range from 0.01 to 10000. that most likely are not faces. This can be an integer or a float in a range from 0.01 to 10000. |
public |
download(string $destination) : bool (true = download success, false = failed) Download filelink as a file, saving it to specified destination be folder name (defaults to stored filename) |
public |
enhance() : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the enhance task |
public |
getContent() : string (file content) Get the content of filelink |
public |
getConvertTaskInfo(string $conversion_url) : \Filestack\json Get the info of a conversion task given the conversion url |
public |
getMetaData(array $fields=array()) : array Get metadata of filehandle possible fields are: mimetype, filename, size, width, height, location, path, container, exif, uploaded (timestamp), writable, cloud, source_url |
public |
getSafeForWork() : \Filestack\json Get the sfw (safe for work) flag for this filelink |
public |
getTags() : \Filestack\json Get the tags for this filelink |
public |
getTransformStr(string $taskname, array $process_attrs) : Transformation object Return the URL portion of a transformation task |
public |
get_retry_miliseconds(int $retry_num) : int Get the miliseconds of exponential backoff retry strategy |
public |
isUrl(string $url) : bool Check if a string is a valid url. |
public |
modulate(int $brightness=100, int $hue, int $saturation=100) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the modulate task image. The value range is 0 to 10000. range is 0 - 359, where 0 is the equivalent of red and 180 is the equivalent of cyan. The value range is 0 to 10000. |
public |
monochrome() : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the monochrome task |
public |
negative() : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the negative task |
public |
oilPaint(int $amount=2) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the oil_paint task paint filter. The value range is 1 to 10. |
public |
overwrite(string $filepath) : boolean Overwrite this filelink in cloud storage |
public |
partialBlur(int $amount=10, int $blur=4, array $objects=array(), string $type='rect' ) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the partial_blur task is an array of arrays. Each array input for this parameter defines a different section of the image and must have exactly 4 integers: 'x coordinate,y coordinate,width,height' - e.g. 10,20,200,250 selects a 200x250px rectangle starting 10 pixels from the left edge of the image and 20 pixels from the top edge of the image. The values for these arrays can be any integer from 0 to 10000. (for a rectangle shape) or oval (for an oval shape). |
public |
partialPixelate(int $amount=10, int $blur=4, array $objects=array(), string $type='rect' ) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the partial_pixelate task is an array of arrays. Each array input for this parameter defines a different section of the image and must have exactly 4 integers: 'x coordinate,y coordinate,width,height' - e.g. 10,20,200,250 selects a 200x250px rectangle starting 10 pixels from the left edge of the image and 20 pixels from the top edge of the image. The values for these arrays can be any integer from 0 to 10000. (for rectangle shape) or oval (for oval shape). |
public |
pixelate(int $amount=2) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the pixelate task filter. The value range is 2 to 100. |
public |
polaroid(string $background='white' , string $color='snow' , int $rotate=45) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the polaroid task the image. This can be the word for a color, or the hex color code, ('red' or 'FF0000') a word or the hex value ('red' or 'FF0000') Range is 0 to 359. |
public |
quality(int $value) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the quality task reduce the file size of the image by reducing the quality. If file is not a JPG, the original file will be returned. If after the conversion, the resulting file is not smaller than the original, the original file will be returned. Using quality as a seperate task is better when no previous image manipulations (no previous recompressions) have been done. (1 to 100) |
public |
redEye() : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the redeye task |
public |
resetTransform() : void Reset the transformation url of this Filelink. Call this function if you are calling multiple transformations on the same filelink without using the transform method. |
public |
resize(int $width, int $height, string $fit='clip' , string $align='center' ) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the resize task The range is 1 to 10000. The range is 1 to 10000. 'clip': Resizes the image to fit within the specified parameters without distorting, cropping, or changing the aspect ratio. 'crop': Resizes the image to fit the specified parameters exactly by removing any parts of the image that don't fit within the boundaries. 'scale': Resizes the image to fit the specified parameters exactly by scaling the image to the desired size. The aspect ratio of the image is not respected and the image can be distorted using this method. 'max': Resizes the image to fit within the parameters, but as opposed to 'clip' will not scale the image if the image is smaller than the output size. to focus on. Possible values: center, top, bottom, left, right, or faces You can also specify pairs e.g. align:[top,left]. Center cannot be used in pairs. |
public |
rotate(string $background='white' , int $deg, bool $exif=false) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the rotate task the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') clockwise (0 to 359). Alternatively, you can set the degree to 'exif' and the image will be rotated based upon any exif metadata it may contain. EXIF orientation 1. The exif=false parameter takes an image and sets the exif orientation to the first of the eight EXIF orientations. The image will behave as though it is contained in an html img tag if displayed in application that supports EXIF orientations. |
public |
roundedCorners(string $background='white' , float $blur=0.3, int $radius=10) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the rounded_corners task the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') rounded edges of the image. (0 - 20). the image. (0-10000) |
public |
save(array $options=array()) : \Filestack\Filestack\Filelink Save this transformed filelink in cloud storage |
public |
sendDebug(string $transform_url, string $api_key, \Filestack\FilestackSecurity $security=null) : json object Send debug call enabled |
public |
sendDelete(string $handle, string $api_key, \Filestack\FilestackSecurity $security) : bool (true = delete success, false = failed) Delete a file from cloud storage required for this call |
public |
sendOverwrite(string $resource, string $handle, string $api_key, \Filestack\FilestackSecurity $security) : \Filestack\Filestack\Filelink Overwrite a file in cloud storage required for this call |
public |
sendTransform(string $resource, array $transform_tasks, \Filestack\FilestackSecurity $security=null) : \Filestack\Filestack\Filelink Applied array of transformation tasks to handle or external url enabled |
public |
sendVideoConvert(string $resource, array $transform_tasks, \Filestack\FilestackSecurity $security=null, bool $force=false) : string (uuid of conversion task) Send video_convert request to API enabled |
public |
sepia(int $tone=80) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the sepia task should be 0 to 100. |
public |
setTransformUrl(mixed $method, array $options=array()) : void Append or Create a task to the transformation url for this filelink |
public |
shadow(string $background='white' , int $blur=4, int $opacity=60, array $vector=array()) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the shadow task the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') Value range is 0 to 20. Value range is 0 to 100. value must be an array of two integers in a range from -1000 to 1000. These are the X and Y parameters that determine the position of the shadow. |
public |
sharpen(int $amount=2) : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the sharpen task should be 0 to 20. |
public |
signedUrl(\Filestack\FilestackSecurity $security) : string return the URL (cdn) of this filelink with security policy |
public |
tornEdges(string $background='white' , array $spread=array()) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the torn_edges task the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') value must be an array of two integers in a range from 1 to 10000. |
public |
transform(array $transform_tasks) : Filestack\Filelink or contents Applied array of transformation tasks to this file link. optional attributes per task |
public |
upscale(string $noise='none' , string $style='photo' , bool $upscale=true) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the upscale task Setting to reduce the level of noise in an image. This noise reduction is performed algorithmically and the aggressiveness of the noise reduction is determined by low, medium and high gradations. If the image being upscaled is a drawing or piece of artwork with smooth lines, you will receive better results from the upscaling process if you also include the artwork style parameter. dimensions of the original. If false is passed as part of the task, then features like noise reduction can be used without changing the resolution of the image. |
public |
url() : string return the URL (cdn) of this filelink |
public |
vignette(int $amount=20, string $background='white' , string $blurmode='gaussian' ) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the vignette task the image. This can be the word for a color, or the hex color code, e.g. ('red' or 'FF0000') Controls the type of blur applied to the vignette - linear or gaussian. The vignette effect uses gaussian blur by default because it produces a more defined vignette around the image. Specifying linear is faster, but produces a less-defined blur effect, even at higher amounts. |
public |
watermark(string $file_handle, string $position='center' , int $size=100) : \Filestack\Filestack/FilelinkSet this Filelink's transform_url to include the watermark task you want to layer on top of another image as a watermark. The position of the overlayed image. These values can be paired as well like position: [top,right]. of its original size. The value must be an integer between 1 and 500. |
public |
zip() : \Filestack\Filestack/Filelink Set this Filelink's transform_url to include the zip task |
\Filestack\FilestackSecurity](#class-filestackfilestacksecurity) $security) : \Filestack\json Get the safe for work (sfw) flag of a filelink. security settings is turned on |
|
protected |
sendGetTags(string $handle, \Filestack\FilestackSecurity $security) : \Filestack\json Get the tags of a filelink. security settings is turned on |
protected |
sendRequest(mixed $method, string $url, array $data=array(), array $headers=array()) : void Send request |
protected | settlePromises(mixed $promises) : void |
FilestackClient client. This is the main object to make functional calls to the Filestack API.
Visibility | Function |
---|---|
public |
__construct(string $api_key, \Filestack\FilestackSecurity $security=null, \Filestack\GuzzleHttp\Client $http_client=null, \Filestack\UploadProcessor $upload_processor=null) : void FilestackClient constructor security settings is turned on one if not passed in |
public |
collage(array $sources, int $width, int $height, array $store_options=array(), string $color='white' , string $fit='auto' , int $margin=10, bool $auto_rotate=false) : Filestack/Filelink or contentsSet this Filelink's transform_url to include the collage task urls. These are the images that will comprise the other images in the collage. The order in which they appear in the array dictates how the images will be arranged. word or hex value, e.g. ('red' or 'FF0000') images in the collage are manipulated so that the final collage image will match the height and width parameters you set more closely. Using crop will produce a result that is closest to the height and width parameters you set. the images. Range is 1 to 100. rotates all the images in the collage according to their exif orientation data. |
public |
convertAudio(string $resource, string $format, array $options=array(), bool $force=false) : string (uuid of conversion task) Convert url or filelink handle to another audio format. IMPORTANT: To use this function, you must setup webhooks to notify you when the transcoding has completed. See our online documentation for more details: https://www.filestack.com/docs/audio-transformations convert to. e.g (aac, hls, mp3, m4a, oga) access: public or private Indicates that the file should be stored in a way that allows public access going directly to the underlying file store. For instance, if the file is stored on S3, this will allow the S3 url to be used directly. This has no impact on the ability of users to read from the Filestack file URL. Defaults to 'private'. audio_bitrate: Sets the audio bitrate for the audio file that is generated by the transcoding process. Must be an integer between 0 and 999. audio_channels: Set the number of audio channels for the audio file that is generated by the transcoding process. Can be an integer between 1 and 12. Default is same as source audio. audio_sample_rate: Set the audio sample rate for the audio file that is generated by the transcoding process. Can be an integer between 0 and 99999. Default is 44100. clip_length: Set the length of the audio file that is generated by the transcoding process. Format is hours:minutes:seconds e.g. (00:00:20) clip_offset: Set the point to begin the audio clip from. For example, clip_offset:00:00:10 will start the audio transcode 10 seconds into the source audio file. Format is hours:minutes:seconds, e.g. (00:00:10) container: The bucket or container in the specified file store where the file should end up. extname: Set the file extension for the audio file that is generated by the transcoding process, e.g. ('.mp4', '.webm') filename: Set the filename of the audio file that is generated by the transcoding process. force: (bool) set to true to restart completed or pending audio encoding if a transcoding fails, and you make the same request again location: The custom storage service to store the converted file to, options incude 'S3', 'azure', 'gcs', 'rackspace', and 'dropbox' path: The path to store the file at within the specified file store. For S3, this is the key where the file will be stored at. By default, Filestack stores the file at the root at a unique id, followed by an underscore, followed by the filename, for example "3AB239102DB_myaudio.mp3" title: Set the title in the file metadata. or pending audio encoding if a transcoding fails, and you make the same request again |
public |
convertFile(string $resource, string $filetype, array $options=array()) : \Filestack\Filestack/Filelink Convert audio file from url or filelink handle to another format. To see which format can be converted, see: https://www.filestack.com/docs/image-transformations/conversion convert the file. e.g (doc, docx, html, jpg, ods, odt, pdf, png, svg, txt, webp) background: Set a background color when converting transparent .png files into other file types. Can be a word or hex value, e.g. ('white' or 'FFFFFF') colorspace: RGB, CMYK or Input By default we convert all the images to the RGB color model in order to be web friendly. However, we have added an option to preserve the original colorspace. This will work for JPEGs and TIFFs. compress: (bool) You can take advantage of Filestack's image compression which utilizes JPEGtran and OptiPNG. The value for this parameter is boolean. If you want to compress your image then the value should be true. Compression is off/false by default. density: (int, 1 to 500). You can adjust the density when converting documents like PowerPoint, PDF, AI and EPS files to image formats like JPG or PNG. This can improve the resolution of the output image. docinfo: (bool) Set this to true to get information about a document, such as the number of pages and the dimensions of the file. page: (int, 1 to 10000) If you are converting a file that contains multiple pages such as PDF or powerpoint file, you can extract a specific page using the page parameter. pageformat: set the page size used for the layout of the resultant document. This parameter can be used when converting the format of one document into PDF, PNG, or JPG. Possible values: 'A3', 'A4', 'A5', 'B4','B5', 'letter', 'legal', 'tabloid' pageorientation: portrait or landscape determine the orientation of the resulting document. This parameter can be used when converting the format of one document into PDF, PNG, or JPG. quality: (int, 1 to 100, or 'input') You can change the quality (and reduce the file size) of JPEG images by using the quality parameter. The quality is set to 100 by default. A quality setting of 80 provides a nice balance between file size reduction and image quality. If the quality is instead set to "input" the image will not be recompressed and the input compression level of the jpg will be used. secure: (bool) This parameter applies to conversions of HTML and SVG sources. When the secure parameter is set to true, the HTML or SVG file will be stripped of any insecure tags (HTML sanitization). Default setting is false. strip: (bool) Set to true to remove any metadata embedded in an image. |
public |
convertVideo(string $resource, string $format, array $options=array(), bool $force=false) : string (uuid of conversion task) Convert a video file from url or filelink handle to another video format. IMPORTANT: To use this function, you must setup webhooks to notify you when the transcoding has completed. See our online docs for more details: https://www.filestack.com/docs/video-transformations convert to. e.g (aac, h264, h264.hi, hls.variant, hls.variant.audio, m4a, mp3, oga, ogg, ogg.hi, webm, webm.hi) access: public or private Indicates that the file should be stored in a way that allows public access going directly to the underlying file store. For instance, if the file is stored on S3, this will allow the S3 url to be used directly. This has no impact on the ability of users to read from the Filestack file URL. Defaults to 'private'. aspect_mode: set the aspect mode (default: letterbox) 'preserve` - Original size and ratio is preserved. 'constrain' - Aspect ratio is maintained, No black bars are added to the output. 'crop' - Fills frame size and crops the rest 'letterbox' - Adds black bars to defined height 'pad' - Adds black bars to output to match defined frame size audio_bitrate: Sets the audio bitrate for the audio file that is generated by the transcoding process. Must be an integer between 0 and 999. audio_channels: Set the number of audio channels for the audio file that is generated by the transcoding process. Can be an integer between 1 and 12. Default is same as source audio. audio_sample_rate: Set the audio sample rate for the audio file that is generated by the transcoding process. Can be an integer between 0 and 99999. Default is 44100. clip_length: Set the length of the video file that is generated by the transcoding process. Format is hours:minutes:seconds e.g. (00:00:20) clip_offset: Set the point to begin the video clip from. For example, clip_offset:00:00:10 will start the audio transcode 10 seconds into the source audio file. Format is hours:minutes:seconds, e.g. (00:00:10) container: The bucket or container in the specified file store where the file should end up. extname: Set the file extension for the audio file that is generated by the transcoding process, e.g. ('.mp4', '.webm') fps: Specify the frames per second of the video that is generated by the transcoding process. Must be an integer between 1 and 300 Default is to copy the original fps of the source file. filename: Set the filename of the audio file that is generated by the transcoding process. keyframe_interval: Adds a key frame every 250 frames to the video that is generated by the transcoding process. Default is 250. location: The custom storage service to store the converted file to, options incude 'S3', 'azure', 'gcs', 'rackspace', and 'dropbox' path: The path to store the file at within the specified file store. For S3, this is the key where the file will be stored at. By default, Filestack stores the file at the root at a unique id, followed by an underscore, followed by the filename, for example "3AB239102DB_myaudio.mp3" title: Set the title in the file metadata. two_pass: Specify that the transcoding process should do two passes to improve video quality. Defaults to false. width: Set the width in pixels of the video that is generated by the transcoding process. height: Set the height in pixels of the video that is generated by the transcoding process. upscale: Upscale the video resolution to match your profile. Defaults to true. video_bitrate: Specify the video bitrate for the video that is generated by the transcoding process. Must be an integer between 1 and 5000. watermark_bottom: The distance from the bottom of the video frame to place the watermark on the video. (0 to 9999) watermark_left: The distance from the left side of the video frame to place the watermark on the video. (0 to 9999) watermark_right: The distance from the left side of the video frame to place the watermark on the video. (0 to 9999) watermark_left: The distance from the top of the video frame to place the watermark on the video. (0 to 9999) watermark_width: Resize the width of the watermark watermark_height: Resize the height of the watermark watermark_url: The Filestack handle or URL of the image file to use as a watermark on the transcoded video. or pending audio encoding if a transcoding fails, and you make the same request again |
public |
debug(string $resource, array $transform_tasks) : json response Debug transform tasks |
public |
delete(string $handle) : bool (true = delete success, false = failed) Delete a file from cloud storage |
public |
download(string $url, string $destination) : bool (true = download success, false = failed) Download a file, saving it to specified destination be foldername (defaults to stored filename) |
public |
getCdnUrl(mixed $handle) : mixed Get the cdn url of a filestack file |
public |
getContent(string $url) : string (file content) Get the content of file |
public |
getConvertTaskInfo(string $conversion_url) : \Filestack\json Get the info of a conversion task given the conversion url |
public |
getMetaData(string $url, array $fields=array()) : array Get metadata of a file possible fields are: mimetype, filename, size, width, height, location, path, container, exif, uploaded (timestamp), writable, cloud, source_url |
public |
getSafeForWork(string $handle) : \Filestack\json Get sfw (safe for work) flag of a filelink |
public |
getTags(string $handle) : \Filestack\json Get tags of a filelink |
public |
getTransformStr(string $taskname, array $process_attrs) : Transformation object Return the URL portion of a transformation task |
public |
get_retry_miliseconds(int $retry_num) : int Get the miliseconds of exponential backoff retry strategy |
public |
isUrl(string $url) : bool Check if a string is a valid url. |
public |
overwrite(string $filepath, string $handle) : \Filestack\Filestack\Filelink Overwrite a file in cloud storage |
public |
screenshot(string $url, array/string $store_options=array(), string $agent='desktop' , string $mode='all' , int $width=1024, int $height=768, int $delay) : \Filestack\Filestack/FilelinkTake a screenshot of a URL width is 1024 by default, but can be set to anywhere between 1 to 1920. The height is 768 by default, but can be set to anywhere between 1 to 1080. capturing the webpage. Sometimes pages take longer to load, so you may need to delay the capture in order to make sure the page is rendered before the screenshot is taken. The delay must be an integer between 0 and 10000. |
public |
sendDebug(string $transform_url, string $api_key, \Filestack\FilestackSecurity $security=null) : json object Send debug call enabled |
public |
sendDelete(string $handle, string $api_key, \Filestack\FilestackSecurity $security) : bool (true = delete success, false = failed) Delete a file from cloud storage required for this call |
public |
sendOverwrite(string $resource, string $handle, string $api_key, \Filestack\FilestackSecurity $security) : \Filestack\Filestack\Filelink Overwrite a file in cloud storage required for this call |
public |
sendTransform(string $resource, array $transform_tasks, \Filestack\FilestackSecurity $security=null) : \Filestack\Filestack\Filelink Applied array of transformation tasks to handle or external url enabled |
public |
sendVideoConvert(string $resource, array $transform_tasks, \Filestack\FilestackSecurity $security=null, bool $force=false) : string (uuid of conversion task) Send video_convert request to API enabled |
public |
transform(string $url, array $transform_tasks) : Filestack\Filelink or file content Applied array of transformation tasks to a url optional attributes per task |
public |
upload(string $filepath, array $options=array()) : Filestack\Filelink or file content Upload a file to desired cloud service, defaults to Filestack's S3 storage. values are: S3, gcs, azure, rackspace, dropbox filename: explicitly set the filename to store as mimetype: explicitly set the mimetype intelligent: set to true to use the Intelligent Ingestion flow |
public |
uploadUrl(mixed $resource, array $options=array()) : \Filestack\Filestack\Filelink Upload a url to desired cloud service, defaults to Filestack's S3 storage. Set $options['location'] to specify location, possible values are: S3, gcs, azure, rackspace, dropbox location (string, storage location), filename (string, custom filename), mimetype (string, file mimetype), path (string, path in cloud container), container (string, container in bucket), access (string, public |
public |
zip(array $sources, array $store_options=array()) : Filestack/Filelink or file content Bundle an array of files into a zip file. This task takes the file or files that are passed in the array and compresses them into a zip file. Sources can be handles, urls, or a mix of both |
Class representing a filestack security object
Visibility | Function |
---|---|
public |
__construct(string $secret, array $options=array()) : void Filestack Security constructor your dev portal default is 1 hour call: The calls that you allow this policy to make, e.g: convert, exif, pick, read, remove, stat, store, write, writeUrl container: (regex) store must match container that the files will be stored under expiry: (timestamp) epoch_timestamp expire, defaults to 1hr handle: specific file this policy can access maxSize: (number) maximum file size in bytes that can be stored by requests with policy minSize: (number) minimum file size in bytes that can be stored by requests with policy path: (regex) store must match the path that the files will be stored under. url: (regex) subset of external URL domains that are allowed to be image/document sources for processing |
public |
signUrl(string $url) : string (url with policy and signature appended) Append policy and signature to url |
public |
verify(array $policy, \Filestack\string? $secret) : bool Verify that a policy is valid |