DXF import splits up paths into segments..

Hi everyone, I am trying to take a dxf file, created from solidworks, and edit it in illustrator (I'm running CS3). I can open the file without trouble, but it's tricky to edit, because it splits every line segment up into a separate path and groups each one individually. For instance, a rectangle with rounded corners will be 4 separate straight line segments and 4 semicircles. They look okay if all I was doing was resizing or changing stroke color, but I can't add a fill. I have found that I can select everything and ungroup it all, but then I have to go around and select each touching endpoint and join them one at a time. There has to be a better way to do this.. right?
I have tried several different export options for the dxf and a dwg and a pdf all with the same results..

Have a look at Concatenate.
http://rj-graffix.com/software/plugins.html#concatenate
I've never used it, but it seems to do the trick. For $20, it could save you a lot of time.

Similar Messages

  • When importing a cd it splits the album into separate individual tracks instead of 1 album with numerouse tracks - how do I get them all together

    When I import a CD from the Apple Mac drive it splits the cd into numerous single tracks in itunes instead of 1 album with all the tracks. How can I get it to import to the one place. I did try importing the same cd on a friends apple mac to see if it did the same thing and it imported the cd as 1 album with all tracks in there so I can't understand why it's separating them all.

    This happens mostly when you import a compilation or a CD that is not noted in the Gracenote Database.
    How to change back in one Album:
    Mark all titles of that album (shift or cmd click)
    Right click and choose "Get info"
    Fill in the wanted name in "Album" and "Album Artist*"
    Drag&Drop the wanted Album Art to the little window down right in that pane.
    iTunes group and sort albums by that two entry's in the info pane. If the CD is not listed in the database but the titels, iTunes split the album to fit the titles to eventually matching albums of the artists.
    Cheers - Lupunus
    * If you import a compilation, choose "various artits" for the Album Artist field.
    Message was edited by: lupunus

  • Illustrator 6.0 vector paths, when opened in Illustrator CC are now all broken into segments?

    Illustrator 6.0 vector paths, when opened in Illustrator CC are now all broken into segments at key points (ie. a circle, has become a series of 4 quarter circle lines. Has anyone experienced this and is there a quick fix? I still have both Illustrator versions installed and can go back to use the original files, however I'd like to upgrade smoothly without having to redo all my vectors!    

    That is strange sounds like what happens when you open a die built in autocad, in illustrator. What happens if you paste a CS6 path into CC?

  • Split Single IDOC into Multiple IDOC's Based on Segment Type

    Hi Experts,
    I have a scenario IDOC to FILE ,  Split Single IDOC into Multiple IDOC's based on Segment Type
    Outbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Segment 2
    Segment 3
    Status Record
    I should get output like below
    Inbound:
    ZIdocName
    Control Record
    Data Record
    Segment 1
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 2
    Status Record
    ZIdocName
    Control Record
    Data Record
    Segment 3
    Status Record
    Please suggest me step by step process to achieve this task.
    Thanks.

    Thanks a lot Harish for reply.
    I have small doubt. According to your reply , If we have N number of segments in single IDOC with same fields in all segments then for splitting Single IDOC into Multiple IDOC's based on Segment Type we need to duplicate N number of target IDOC tree structure.
    Is that possible to Split single IDOC into Multiple IDOC's based on Segment Type using only one Target IDOC structure without duplicating the Target IDOC structure tree.

  • Importing a path into photoshop

    I created a path in Photoshop CS6 and exported it as a "Paths to Illustrator" vector file to the desktop. Now I want to import the path into another PS file. How do I do this?
    I cannot copy and paste the path as I no longer have the original file that was used to create the path. This seems to be a simple task that I'm sure used to be easily done by importing the path in older versions of PS.
    Thx

    Photoshop Is not a file editor.   You can add path to a photoshop document several ways.  When you have the path in one open document you can Create a custom shape and then use the shape path in any document using the custom shape tool.  You can drag a path for one document's path palette and drop it onto an other open document.  You can insert the path into an action step and that step will inset the path into documents the action is used on.  You can save custom shapes and action with insert path steps a copy the saved file onto other machines and load them into Photoshop..  When you save Open documents that have path some file formats support paths and will save paths in the saved image file.  When those file are opened in Photoshop the path will be in the open documents paths palette.
    I have never used illustrator however if you have the AI file and illustrator there may be a way to open the .AI file in illustrator  export the path to Photoshop,  It may have an export path to Photoshop or perhaps you can drag and drop between applications.  However I don't know all I know is Photoshop has a menu  File>Export Path to Illustrator. However the is no menu File>Import Paths from illustrator.  When I use menu File>Export Path To Illustrator Photoshop saves a *.ai file.  If I drop the file on Photoshop Photoshop want to open it a s rasterized ESP document in CMYKt and there is no Path in the paths palette.

  • Import footage without the video breaking up into segments?

    Is there a way to import video footage from my canon HD vixia 30, without it breaking up into segments
    everytime the camera was turned off?
    thanks in advance for any help

    No. HDV will always make a break at the start/stop points on the tape using FCE.
    It's a consequence of the Mpeg file layout.
    Al

  • DVR Splits Recorded Show into Two Segments?

    I was wondering if anyone else has had an issue with their DVR splitting a show into two segments?
    I have the Motorola 7216? Home Media DVR.  At times, when we record a show, and then go to play it, the show will be listed in the Recorded Programs as two shows.  For instance, the first listing will list that the show recorded for 7 minutes.  Then, the second listing of the same show will show that it recorded for the remaining 23 minutes.  It is the same 30 minute show, but for some reason, the DVR stops recording after so many minutes, and then finishes recording the show as a second show.
    Has this happened with anyone else, and if so, is there anything that can be done to fix this?  The only answer I have gotten from Verizon is to unplug the DVR to reset it. 
    This doesn't happen all the time, but it happens enough that I find this annoying.
    I would appreciate any input anyone can give.  Thanks.
    Solved!
    Go to Solution.

    MiMeQu wrote:
    I was wondering if anyone else has had an issue with their DVR splitting a show into two segments?
    I have the Motorola 7216? Home Media DVR.  At times, when we record a show, and then go to play it, the show will be listed in the Recorded Programs as two shows.  For instance, the first listing will list that the show recorded for 7 minutes.  Then, the second listing of the same show will show that it recorded for the remaining 23 minutes.  It is the same 30 minute show, but for some reason, the DVR stops recording after so many minutes, and then finishes recording the show as a second show.
    Has this happened with anyone else, and if so, is there anything that can be done to fix this?  The only answer I have gotten from Verizon is to unplug the DVR to reset it. 
    This doesn't happen all the time, but it happens enough that I find this annoying.
    I would appreciate any input anyone can give.  Thanks.
    This has happened to me on occasion, but  the reason was that there was a power surge, and the box rebooted.  Or, if the STB crashes and reboots, it also splits the recording.  Other than power issues or stb reboots, it hasn't happened, and I have the same STB.

  • Dxf import

    Hi.
    I am doing some work for a client who would laike to be able to import CAD drawings into some Labwindows CVI software I  am writing. It is a non-destructive testing application and my business is supplying ultrasonic instrumentation and a software package written in Labwindows. The ultrasonic transducer assembly will be position encoded and manually controlled and the client would like the path followed by the transducer assembly plotted on the CAD drawing of the structure being inspected.
    I wrote a routine a few years ago that imports an STL file into Labwindows and displays the 3D image using the OGL library. It works  OK, but DXF or DWG import would be better. I gave up on writing code for DXF import because it is quite difficult. Is there any third party CAD import software that integrates with Labwindows? It does not need to be free, but it does need to be easy to use.
    I  have searched the forum but could not find any posts on CAD import or DXF import.
    Any help  would be appreciated.
    Regards
    John Norman

    Hi.
    I was also thinking along the lines of adding the probe path data to a new layer. Glad you confirmed my thinking on this.
    The last time I looked, about 4 years ago, I could not find any satisfactory DXF import routine that I could use. At that time I wwas looking for code examples so that I could write my own routines. It just seemed to difficult at the time to write a routine recognizing all the entities in a DXF file that will allow a  sensible reproduction of the drawing, so I gave up.
    This time I am more interested in plugins that will work  or can be made to work with LabWindows. Has anyone tried using the OpenCascade DXF import/export routines, for example? These routines are not free, but that does not matter this time. Is there anything else out there that might work with LabWindows?
    When I looked into this in the past, I seem to recall finding some forum discussions on the subject of DXF import into LabWindows, but I don't seem to be able to find them again.
    Regards
    John Norman

  • Help needed with SQL to split huge data into two excel or text files.

    Hi,
    I have a table which has around 1850000 records. I want to split the data into two sets and import the data in .txt or execl file.
    How can i break upthe records using rownum or any thing
    select * from tablename where rownum<940000 fetched some records
    but
    when i gave select * from tablename where rownum>940000 it was not fetching records.
    Guideme

    when i gave select * from tablename where rownum>940000 it was not fetching records.try this
    select * from (select tablename.*, rownum rn from tablename) where rn >940000

  • Storing Uploaded Image Path into Mysql

    Hi I am developing a cms and am using the code David gives in his book PHP Solutions,  everything works fine but I can't work out how to extract the uploaded path so that it is stored in my table.
    Help would be really appreciated, I am making good progress in learning the php especially with David's books but am still struggling when it comes to having to customized the code.
    The code for the upload.php is as follows,
    <?php
    class Gp1_Upload{
      protected $_uploaded = array();
      protected $_destination;
      protected $_max = 51200;
      protected $_messages = array();
      protected $_permitted = array('image/gif',
                                    'image/jpeg',
                                    'image/pjpeg',
                                    'image/png');
      protected $_renamed = false;
      public function __construct($path) {
        if (!is_dir($path) || !is_writable($path)) {
          throw new Exception("$path must be a valid, writable directory.");
        $this->_destination = $path;
        $this->_uploaded = $_FILES;
      public function getuploadpath (){
      public function getMaxSize() {
        return number_format($this->_max/1024, 1) . 'kB';
      public function setMaxSize($num) {
        if (!is_numeric($num)) {
          throw new Exception("Maximum size must be a number.");
        $this->_max = (int) $num;
      public function move($overwrite = false) {
        $field = current($this->_uploaded);
        if (is_array($field['name'])) {
          foreach ($field['name'] as $number => $filename) {
            // process multiple upload
            $this->_renamed = false;
            $this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $overwrite);   
        } else {
          $this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $overwrite);
      public function getMessages() {
        return $this->_messages;
      protected function checkError($filename, $error) {
        switch ($error) {
          case 0:
            return true;
          case 1:
          case 2:
            $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
            return true;
          case 3:
            $this->_messages[] = "Error uploading $filename. Please try again.";
            return false;
          case 4:
            $this->_messages[] = 'No file selected.';
            return false;
          default:
            $this->_messages[] = "System error uploading $filename. Contact webmaster.";
            return false;
      protected function checkSize($filename, $size) {
        if ($size == 0) {
          return false;
        } elseif ($size > $this->_max) {
          $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
          return false;
        } else {
          return true;
      protected function checkType($filename, $type) {
        if (empty($type)) {
          return false;
        } elseif (!in_array($type, $this->_permitted)) {
          $this->_messages[] = "$filename is not a permitted type of file.";
          return false;
        } else {
          return true;
      public function addPermittedTypes($types) {
        $types = (array) $types;
        $this->isValidMime($types);
        $this->_permitted = array_merge($this->_permitted, $types);
      protected function isValidMime($types) {
        $alsoValid = array('image/tiff',
                           'application/pdf',
                           'text/plain',
                           'text/rtf');
          $valid = array_merge($this->_permitted, $alsoValid);
        foreach ($types as $type) {
          if (!in_array($type, $valid)) {
            throw new Exception("$type is not a permitted MIME type");
      protected function checkName($name, $overwrite) {
        $nospaces = str_replace(' ', '_', $name);
        if ($nospaces != $name) {
          $this->_renamed = true;
        if (!$overwrite) {
          $existing = scandir($this->_destination);
          if (in_array($nospaces, $existing)) {
            $dot = strrpos($nospaces, '.');
            if ($dot) {
              $base = substr($nospaces, 0, $dot);
              $extension = substr($nospaces, $dot);
            } else {
              $base = $nospaces;
              $extension = '';
            $i = 1;
            do {
              $nospaces = $base . '_' . $i++ . $extension;
            } while (in_array($nospaces, $existing));
            $this->_renamed = true;
        return $nospaces;
      protected function processFile($filename, $error, $size, $type, $tmp_name, $overwrite) {
        $OK = $this->checkError($filename, $error);
        if ($OK) {
          $sizeOK = $this->checkSize($filename, $size);
          $typeOK = $this->checkType($filename, $type);
          if ($sizeOK && $typeOK) {
            $name = $this->checkName($filename, $overwrite);
            $success = move_uploaded_file($tmp_name, $this->_destination . $name);
            if ($success) {
                $message = "$filename uploaded successfully";
                if ($this->_renamed) {
                  $message .= " and renamed $name";
                $this->_messages[] = $message;
            } else {
              $this->_messages[] = "Could not upload $filename";
    ?>
    The code for my form page is this
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    //THE FOLLOWING CODE IS FOR THE UPLOADING OF IMAGES AND FILES
    // set the max upload size in bytes
    $max = 51200;
    if (isset ($_POST ['submit']))
                //define the path to the upload folder
                $destination = 'uploads/';
                require_once('classes/Upload.php');
                try {
                    $upload = new Gp1_Upload($destination);
                    $upload->setMaxSize($max);
                    $upload->move();
                    $result = $upload->getMessages();
                } catch (Exception $e) {
                    echo $e->getMessage();
    // END OF UPLOADING OF IMAGES AND FILES
    ?>
    <form id="newvenue" action="" method="post" enctype="multipart/form-data" >
          <?php
               // THIS CODE DISPLAYS ERROR MESSAGES FOR THE FILE UPLOADS
              if (isset($result)){
              echo '<ul>';
              foreach ($result as $message){
                  echo "<li>$message</li>";
              echo '</ul>';
           ?>
      <table id="neweventdisplay" cellpadding="5"  border="0">
        <tr>
      <td></td>
      <td><input type="hidden" name="user_id"  value="" /></td>
      </tr>
      <tr>
      <td></td>
        <td>Organisers Name</td>
        <td><input class="input80px" id="org_name" name="org_name" type="text" /> </td>
      </tr>
      <tr>
      <td></td>
      <td><label for="image">Upload image:</label></td>
      <td><p>
    <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max; ?>" />
    <input type="file" name="image" id="image" />
    </p></td>
    </tr>
      <tr>
      <td></td>
      <td>Details about your upload</td>
      <td><input class="input80px" id="org_uploadcapt" name="org_uploadcapt" type="text"  /></td>
    </tr>
      <tr>
      <td></td>
      <td><input type="submit" name="submit" id="submit" value="upload"></td>
      </tr>
      <tr>
      <td class="heading"> </td>
      <td></td>
      </tr>
    </table>
    </form>
    <prep>
    <?php
    if (isset ($_POST ['submit'])){
        print_r($_FILES);}
        ?>
        </prep>
    </body>
    </html>

    Hi David
    Thank you very much for your help.  I had continued to work on the code and had worked out how to input the image path into the database but it was using the original filename, so when every it is changed it did not work.  The code in my page at that point was the following,
    <?php     // 2. NEW USER REGISTRATION<br />
            include_once ("includes/form_functions.inc.php");
            $max = 100000;
            $destination = 'uploads/';
            // START FORM PROCESSING FOR A NEW REGISTRATION
            if (isset($_POST['submit'])) { // Form has been submitted.
            $errors = array();
            // perform validations on the form data
            $required_fields = array('org_name');
            $errors = array_merge($errors, check_required_fields($required_fields, $_POST));    
            $required_numberfields = array('user_id');
            $errors = array_merge($errors, check_number_fields($required_numberfields, $_POST));
            $fields_with_lengths = array('org_name' => 36, 'org_website' => 100, 'org_contact' => 40,  'org_conemail' => 80, 'org_contel' => 30);
            $errors = array_merge($errors, check_max_field_lengths($fields_with_lengths, $_POST));
            /*Here I am using trim as well as ucwords, this function converts the first letter of each work into a capital letter,  I am using this only on the
            firstname and surname to ensure that the data is how I want it as it is going  into the database,  The better the data is preformated the better the data
            swill be within the database.*/
            $org_name = trim(strtolower(mysql_prep($_POST['org_name'])));
            $org_website = trim(strtolower(mysql_prep($_POST['org_website'])));
            $org_contact = trim(strtolower (mysql_prep($_POST['org_contact'])));
            $org_conemail = trim(strtolower (mysql_prep($_POST['org_conemail'])));
            $org_contel = strtolower (mysql_prep($_POST['org_contel']));
            $userid = $_POST['user_id'];
            $org_uploadcapt = $_POST['org_uploadcapt'];
            $image = $_FILES['image'];
            /*Here is the code that takes the variable captured from the input form and matches it  up with the appropriate field in the database.  An important point with insertion is that  the variables are in the same order as the mysql field names, there will be an error if the number of variables does not match the number of field names.  Note that there is no entry for the user id as this is an auto increment file within mysql and so is not needed to be entered*/
            if ( empty($errors) ) {
                $sql = "INSERT INTO organiser
                          (org_name, org_website, org_contact, org_conemail, org_contel, user_id, org_uploadurl, org_uploadcapt)
                          VALUES
                          ('{$org_name}', '{$org_website}', '{$org_contact}', '{$org_conemail}', '{$org_contel}', '{$userid}', '{$destination}".$image['name']."', '{$org_uploadcapt}' )";
                $result = mysql_query($sql, $connection);
                if ($result) {
                    $message = "The organiser was successfully created.<br />";
                } else {
                    $message = "I am sorry but the organiser could not be added.";
                    $message .= "<br />" . mysql_error();
                } else {
                    /* this counts the number of errors and informs the user of how many fields were
                    incorrectly entered*/
                if (count($errors) == 1) {
                    $message = "There was 1 error in the form.";
                } else {
                    $message = "There were " . count($errors) . " errors in the form.";
        } else { // Form has not been submitted.
            $org_name = "";
            $org_website = "";
            $org_contact = "";
            $org_conemail = "";
            $org_contel = "";
            $userid = "";
            $org_uploadcapt = "";
    //THE FOLLOWING CODE IS FOR THE UPLOADING OF IMAGES AND FILES
    // set the max upload size in bytes
    if (isset ($_POST ['submit']))
                //define the path to the upload folder
                // Use This On The Local Hosting Machine
                //$destination = 'C:/upload_test/';
                // Use This On The Live Server
                require_once('classes/Upload.php');
                try {
                    $upload = new Gp1_Upload($destination);
                    $upload->setMaxSize($max);
                    $upload->move();
                    $result = $upload->getMessages();
                } catch (Exception $e) {
                    echo $e->getMessage();
    // END OF UPLOADING OF IMAGES AND FILES
    ?>
    <title>Horse Events</title>
    <?php include_once("includes/meta.inc.php");?>
    <?php include_once("includes/cssfavgoogle.inc.php");?>
    <link href="css/adminpanel.css" rel="stylesheet" type="text/css" />
    <style>
    input[type="number"] {
        width:40px;
    </style>
    </head>
    <body>
    <div id="wrapper">
        <div id="admincontent">
    <form id="newvenue" action="neworganiser.php" method="post" enctype="multipart/form-data" >
          <?php if (!empty ($message)) {echo "<p class=\"message\">" . $message . "</p>";} ?>
          <?php if (!empty ($errors)) {display_errors($errors); } ?>
          <?php
              // THIS CODE DISPLAYS ERROR MESSAGES FOR THE FILE UPLOADS
              if (isset($result)){
              echo '<ul>';
              foreach ($result as $message){
                  echo "<li>$message</li>";
              echo '</ul>';
           ?>
    <br />
          <table id="neweventdisplay" cellpadding="5"  border="0">
        <tr>
      <td></td>
      <td><input type="hidden" name="user_id"  value="<?php echo $url_userid ['user_id']; ?>" /></td>
      </tr>
      <tr>
      <td> <span class="compuls">*</span></td>
        <td>Organisers Name</td>
        <td><input class="input80px" id="org_name" name="org_name" type="text" />
         </td>
      </tr>
          <tr>
          <td><span class="compuls">*</span></td>
        <td>Their Website</td>
        <td><input class="input80px" id="org_website" name="org_website" type="text" /></td>
      </tr>
        <tr>
        <td><span class="compuls">*</span></td>
        <td>Organisers Contact</td>
        <td><input id="org_contact" name="org_contact" type="text" />eg: Mrs Jean Kelly</td>
      </tr>
        <tr>
        <td><span class="compuls">*</span></td>
        <td>Contact Email</td>
        <td><input class="input80px" id="org_conemail" name="org_conemail" type="text" />
          </td>
      </tr>
        <tr>
        <td><span class="compuls">*</span></td>
      <td>Contact Tel No.</td>
      <td><input id="org_contel" name="org_contel" type="text" /></td>
      </tr>
      <tr>
      <td></td>
      <td><label for="image">Upload image:</label></td>
      <td><p>
    <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max; ?>" />
    <input type="file" name="image" id="image" />
    </p></td>
    </tr>
      <tr>
      <td></td>
      <td>Details about your upload</td>
      <td><input class="input80px" id="org_uploadcapt" name="org_uploadcapt" type="text"  /></td>
    </tr>
      <tr>
      <td></td>
      <td><input type="submit" name="submit" id="submit" value="Add Your Organiser"></td>
      </tr>
      <tr>
      <td class="heading"> </td>
      <td></td>
      </tr>
    </table>
    <a  class="delete" href="controlpanel.php">Cancel</a>
    </form>
        </div>
    I have added the code you kindly forwarded but am getting an error,  I am still trying to learn the basics of php and am unsure of what to do next, my php Upload.php now looks like
    <?php
    class Gp1_Upload{
      protected $_uploaded = array();
      protected $_destination;
      protected $_max = 100000;
      protected $_messages = array();
      protected $_permitted = array('image/gif',
                                    'image/jpeg',
                                    'image/pjpeg',
                                    'image/png');
      protected $_renamed = false;
      protected $_filenames = array();
      public function __construct($path) {
        if (!is_dir($path) || !is_writable($path)) {
          throw new Exception("$path must be a valid, writable directory.");
        $this->_destination = $path;
        $this->_uploaded = $_FILES;
      public function getMaxSize() {
        return number_format($this->_max/100000, 1) . 'kB';
      public function setMaxSize($num) {
        if (!is_numeric($num)) {
          throw new Exception("Maximum size must be a number.");
        $this->_max = (int) $num;
      public function move($overwrite = false) {
        $field = current($this->_uploaded);
        if (is_array($field['name'])) {
          foreach ($field['name'] as $number => $filename) {
            // process multiple upload
            $this->_renamed = false;
            $this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $overwrite);   
        } else {
          $this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $overwrite);
      public function getMessages() {
        return $this->_messages;
      protected function checkError($filename, $error) {
        switch ($error) {
          case 0:
            return true;
          case 1:
          case 2:
            $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
            return true;
          case 3:
            $this->_messages[] = "Error uploading $filename. Please try again.";
            return false;
          case 4:
            $this->_messages[] = 'No file selected.';
            return false;
          default:
            $this->_messages[] = "System error uploading $filename. Contact webmaster.";
            return false;
      protected function checkSize($filename, $size) {
        if ($size == 0) {
          return false;
        } elseif ($size > $this->_max) {
          $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
          return false;
        } else {
          return true;
      protected function checkType($filename, $type) {
        if (empty($type)) {
          return false;
        } elseif (!in_array($type, $this->_permitted)) {
          $this->_messages[] = "$filename is not a permitted type of file.";
          return false;
        } else {
          return true;
      public function addPermittedTypes($types) {
        $types = (array) $types;
        $this->isValidMime($types);
        $this->_permitted = array_merge($this->_permitted, $types);
      protected function isValidMime($types) {
        $alsoValid = array('image/tiff',
                           'application/pdf',
                           'text/plain',
                           'text/rtf');
          $valid = array_merge($this->_permitted, $alsoValid);
        foreach ($types as $type) {
          if (!in_array($type, $valid)) {
            throw new Exception("$type is not a permitted MIME type");
      protected function checkName($name, $overwrite) {
        $nospaces = str_replace(' ', '_', $name);
        if ($nospaces != $name) {
          $this->_renamed = true;
        if (!$overwrite) {
          $existing = scandir($this->_destination);
          if (in_array($nospaces, $existing)) {
            $dot = strrpos($nospaces, '.');
            if ($dot) {
              $base = substr($nospaces, 0, $dot);
              $extension = substr($nospaces, $dot);
            } else {
              $base = $nospaces;
              $extension = '';
            $i = 1;
            do {
              $nospaces = $base . '_' . $i++ . $extension;
            } while (in_array($nospaces, $existing));
            $this->_renamed = true;
        return $nospaces;
      protected function processFile($filename, $error, $size, $type, $tmp_name, $overwrite) {
        $OK = $this->checkError($filename, $error);
        if ($OK) {
          $sizeOK = $this->checkSize($filename, $size);
          $typeOK = $this->checkType($filename, $type);
          if ($sizeOK && $typeOK) {
            $name = $this->checkName($filename, $overwrite);
            $success = move_uploaded_file($tmp_name, $this->_destination . $name);
            if ($success) {
                $message = "$filename uploaded successfully";
                if ($this->_renamed) {
                  $message .= " and renamed $name";
                $this->_messages[] = $message;
            } else {
              $this->_messages[] = "Could not upload $filename";
      public getFilenames() {
        return $this->_filenames;
    ?>
    The error is Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE.   
    I have not worked with oop before and have only very briefly looked at the principle was on my foundation degree.

  • Importing multiple Word docs into InDesign

    Hi there
    Is it possible to import multiple Word documents into a single InDesign text frame all at once?
    I have 20 files that all flow sequentially so was wondering if -- by selecting them all in Place window -- they would all be brought in one after the other, without each one creating its own new text frame.
    Any help gratefully received.
    Thanks
    Dan

    I use the script, below, for that. It's a bit scruffy, it should be tarted up. But it works fine. When you start it you type a path/file mask, using the formats illustrated in the dialog.
    It sets a few import preferences, these are the only ones I'm interested in. But it'll pick up the other options from their current settings.
    Peter
    // Description: Place multiple textfiles as one story
    #target indesign
    preset = '/d/test/*.rtf';
    app.wordRTFImportPreferences.useTypographersQuotes = true;
    app.wordRTFImportPreferences.convertPageBreaks = ConvertPageBreaks.none;
    app.wordRTFImportPreferences.importEndnotes = true;
    app.wordRTFImportPreferences.importFootnotes = true;
    app.wordRTFImportPreferences.importIndex = true;
    app.wordRTFImportPreferences.importTOC = false;
    app.wordRTFImportPreferences.importUnusedStyles = false;
    mask = prompt ('Enter a file path/mask.\r\r' +
        'Examples:\r' +
        'd:\\books\\test\\*.rtf   /d/books/test/*.rtf', preset);
    if (mask == null) exit();  // Cancel pressed
    ff = Folder (File (mask).path).getFiles (File (mask).name);
    if (ff.length > 0)
        placed = [];
        missed = [];
        tframe = app.documents.add().textFrames.add({geometricBounds : [36, 36, 400, 400]});
        placedstory = tframe.parentStory;
        app.scriptPreferences.userInteractionLevel =
            UserInteractionLevels.neverInteract;
        pb = initprogressbar (ff.length, 'Loading');
        for (i = 0; i < ff.length; i++)
            pb.value = i;
            try
                placedstory.insertionPoints[-1].place (ff[i]);
                placedstory.insertionPoints[-1].contents = '\r\r';
                placed.push (ff[i].name);
            catch (_)
                missed.push( ff[i].name );
        app.scriptPreferences.userInteractionLevel =
            UserInteractionLevels.interactWithAll;
        inform = '';
        if (placed.length > 0)
            inform = 'Placed ' + ff.length + ' files (in this order):\r\r' + placed.join ('\r');
        if (missed.length > 0)
            inform += '\r\rCould not place:\r\r' + missed.join ('\r');
        delete_empty_frames ();
        alert( inform );
    else
        alert (mask + ' not found.');
    // End
    function delete_empty_frames ()
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = '\\A\\Z';
        var empties = app.activeDocument.findGrep (true);
        for (var i = 0; i < empties.length; i++)
            empties[i].parentTextFrames[0].remove()
    function initprogressbar (stop, title)
        progresswindow = new Window('palette', title);
        progressbar = progresswindow.add ('progressbar', undefined, 1, stop);
        progressbar.preferredSize = [200,20];
        progresswindow.show ()
        return progressbar;

  • How do I turn a list of files and paths into this format using AS?

    Hi everyone,
    I'm a complete novice with Applescript and I need some help to script turning a list of files from the Finder into a specific format in a text doc, so I can save as CSV and import into another app (Anki, for learning language).
    Here's an example list of files:
    I can get Automator to spit out the files names and paths into a text file, but I think I need Applescript to turn the result into this:
    <img src="12-1.jpg">;[sound:12-1.caf];;
    <img src="12-2.jpg">;[sound:12-2.caf];;
    <img src="12-3.jpg">;[sound:12-3.caf];;
    <img src="12-4.jpg">;[sound:12-4.caf];;
    Any help would be appreciated.

    This processes the JPG files, and then assumes that the CAF files are in the flle structure you provided.
    Select files in the Image Folder:
    The Run Shell Script [pass input as arguments] is:
    for f in "$@"
    do
         caf="$f"
         caf=${caf/Images/Audio}
         caf=${caf%.*}.caf
         echo \<img src=\""$f"\"\>\;\;[sound:$caf\]\;\;
    done

  • Need help for importing oracle 10G dump into 9i database

    hi, Someone help me to import oracle 10G dump into 9i database. I'm studying oracle . Im using oracle 10G developer suite(downloaded from oracle) and oracle 9i database. I saw some threads tat we can't import the higher version dumps into lower version database. But i'm badly need help for importing the dump...
    or
    someone please tell me the site to download oracle 9i Developer suite as i can't find it in oracle site...

    I didnt testet it to import a dump out of a 10g instance into a 9i instance if this export has been done using a 10g environment.
    But it is possible to perform an export with a 9i environment against a 10g instance.
    I am just testing this with a 9.2.0.8 environment against a 10.2.0.4.0 instance and is working so far.
    The system raises an EXP-00008 / ORA-37002 error after exporting the data segments (exporting post-schema procedural objects and actions).
    I am not sure if it is possible to perform an import to a 9i instance with this dump but maybe worth to give it a try.
    It should potentially be possible to export at least 9i compatible objects/segments with this approach.
    However, I have my doubts if this stunt is supported by oracle ...
    Message was edited by:
    user434854

  • Importing DV and turning into clips

    Hey is there anyway so that iMovie can import from your DV and automatically convert it into clips spread out like Windows Movie Maker. That like cuts up all the scene takes from when you have filmed one section and it breaks up into segments making it so much easier to edit.
    Can you do this with iMovie or can you get a plugin or something??

    I have never tried Windows Movie Maker, so I don't really know what it does.
    From your description it sound like iMovie imports your movie as a single clip.
    Here's how to deal with that problem:
    http://danslagle.dvmix.com/mac/iMovie/video/2006.shtml

  • Importing a CSV file into AD 2012r2

    Hi Guys
    Just wondering if anyone can help, I am a newbie on scripting and finding it really difficult to understand how to import a csv file into AD
    I have created the CSV file with the following headers, see below but I am unable to write a powershell script to import them into AD which work, I have tried multiple help guides but still cannot do it for the life of me.
    Any help on this would be really appreciated 
    objectClass user
    cn Jo bloggs
    givenName jo
    sn blogs
    mail [email protected]
    sAMAccountname j.blogs
    AccountPassword Pa$$w0rd
    ChangePasswordAtLogon true
    PasswordNeverExpires false
    ou OU=staff,DC=test,DC=com

    Import-Csv C:\User.csv| %{New-ADUser -SamAccountName $_.SamAccountName `
    -UserPrincipalName $_.userprinicpalname `
    -Name $_.name `
    -Mail = $_.mail `
    -DisplayName $_.name `
    -GivenName $_.GivenName `
    -Path "OU=Test Users,DC=XXX,DC=XXX" `
    -PasswordNeverExpires $false `
    -ChangePasswordAtLogon $true `
    -AccountPassword (ConvertTo-SecureString "test41;" -AsPlainText -force) `
    -Enabled $True -PasswordNeverExpires $True -PassThru ` }
    help New-ADUser -Examples
    You can try the below sample code
    Regards Chen V [MCTS SharePoint 2010]

Maybe you are looking for