Skip to content

Instantly share code, notes, and snippets.

// ============================================================================
//
// Copyright (c) 2006-2015, Talend Inc.
//
// This source code has been automatically generated by_Talend Open Studio for Data Integration
// / 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
//
//We will collect our results into these arrays, to summarize our results later.
$nofile = Array();
$filecopyerror = Array();
$successlist = Array();
$posterror = Array();
foreach($dl as $d){
//check if file exists
$sourcefile = "/<folder>/Attachments/".$d['source'];
//we're going to rewrite the files to a tmp directory.
//In this case, we only want the documents created by the administrator. (the ones that we imported earlier)
$filter_arguments = array(
"filter" => array(
array(
'$and' => array(
array(
"modified_user_id" => array(
'$equals'=>"1",
)
),
$filetype = Array(
"application/pdf" => ".pdf",
"application/msword" => ".doc",
"application/x-pdf" => ".pdf",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" => ".docx",
"application/vnd.ms-powerpoint" => ".ppt",
"application/x-zip-compressed" => ".zip",
"application/vnd.openxmlformats-officedocument.presentationml.presentation" => ".pptx",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" => ".xlsx",