Error in image file upload using dreamweaver

Greeting to you all!
Please I need you PRO help. My case seem similar to some of the ones I have seen but my code is completely different.
I wrote this code below using PHP in Dreamweaver and its used to upload images to MySQl database. Now when I upload about 6 images, it shows File Uploaded Successfully. But if I try to upload any thing below 6 images, it will refuse to upload and will echo Upload Failed.
<?php
if(isset($_POST['submit']))
          $projid=$_POST['projid'];
          $projname=$_POST['projname'];
          $name=basename($_FILES['file_upload']['name']);
          $t_name=$_FILES['file_upload']['tmp_name'];
          $dir='upload';
          if(move_uploaded_file($t_name,$dir."/".$name))
          $nameone=basename($_FILES['file_uploadone']['name']);
          $t_name=$_FILES['file_uploadone']['tmp_name'];
          $dir='upload1';
          if(move_uploaded_file($t_name,$dir."/".$name))
          $nametwo=basename($_FILES['file_uploadtwo']['name']);
          $t_name=$_FILES['file_uploadtwo']['tmp_name'];
          $dir='upload2';
          if(move_uploaded_file($t_name,$dir."/".$name))
          $namethree=basename($_FILES['file_uploadthree']['name']);
          $t_name=$_FILES['file_uploadthree']['tmp_name'];
          $dir='upload3';
          if(move_uploaded_file($t_name,$dir."/".$name))
          $namefour=basename($_FILES['file_uploadfour']['name']);
          $t_name=$_FILES['file_uploadfour']['tmp_name'];
          $dir='upload4';
          if(move_uploaded_file($t_name,$dir."/".$name))
          $namefive=basename($_FILES['file_uploadfive']['name']);
          $t_name=$_FILES['file_uploadfive']['tmp_name'];
          $dir='upload5';
          if(move_uploaded_file($t_name,$dir."/".$name))
                    mysql_select_db ($database_ProjMonEva,$ProjMonEva);
                    $qur="insert into tbl_images (imageid, projid, projname, name, path, nameone, pathone, nametwo, pathtwo, namethree, paththree, namefour, pathfour, namefive, pathfive) values ('','$projid','$projname','$name','upload/$name','$nameone','upload/$nameone','$nametwo', 'upload/$nametwo','$namethree','upload/$namethree','$namefour','upload/$namefour','$namefi ve','upload/$namefive')";
                    $res=mysql_query($qur,$ProjMonEva);
                    echo 'File uploaded successful';
          else
                    echo 'upload failed!';
?>
I see the problem to come from the echo but I am stock and dont know how to correct it. Can any one please help me.
Thank you in advance Mike

Hi Bregent,
I have been able to resolve the issue. I modified the code this way: This I believe will help those having the same issues.
These is how I was able to achieve it.
1. I divided the code into two parts called addnew.php and addnewproject.php.
The addnewproject.php as seen below will call the addnew.php when the submit button on addnewproject.php is clicked
<form action="addnew.php" method="POST" id="Add New Project" enctype="multipart/form-data">
      <div align="center">
        <table width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td id="formcells4"><strong id="subheaders">Core Details</strong></td>
            <td></td>
          </tr>
          <tr>
            <td id="dates">*Code (Eg. 2104/12/AB23):<br />
              <label for="projcode"></label>
              <span id="sprytextfield1">
              <input type="text" name="projcode" id="projcode2" />
            <span class="textfieldRequiredMsg">A value is required.</span></span><br /></td>
            <td></td>
          </tr>
          <tr>
            <td colspan="2" id="dates">Project Name:
              <label for="projname3"></label>
              <span id="sprytextfield2">
              <input type="text" name="projname" id="projname3" />
              <span class="textfieldRequiredMsg">A value is required.</span></span></td>
          </tr>
          <tr>
            <td colspan="2" id="dates">Project Description:<span id="description"><br />
              <label for="projdesc"></label>
              <span id="txt_projdesc">
                <textarea name="projdesc" id="projdesc" cols="70" rows="8"></textarea>
                <span class="textareaRequiredMsg">A value is required.</span></span></span></td>
          </tr>
          <tr>
            <td id="formcells"><p id="dates">*Date Entered: <em>YYYY/MM/DD</em><span id="year">
              <label for="projappdate"><br />
              </label>
              <span id="txt_dateproapp">
                <input type="text" name="projappdate" id="projappdate" />
                <span class="textfieldRequiredMsg">A value is required.</span></span></span></p></td>
            <td id="formcells"><p id="dates">*Project LGA:<span id="txt_projlga">
              <label for="projlga"><br />
              </label>
              <span id="txt_lga">
                <select name="projlga" id="projlga">
                  <option value="1">.... Select from list ....</option>
                  <?php
do { 
?>
                  <option value="<?php echo $row_rsLGA['lga']?>"><?php echo $row_rsLGA['lga']?></option>
                  <?php
} while ($row_rsLGA = mysql_fetch_assoc($rsLGA));
  $rows = mysql_num_rows($rsLGA);
  if($rows > 0) {
      mysql_data_seek($rsLGA, 0);
            $row_rsLGA = mysql_fetch_assoc($rsLGA);
?>
                </select>
            <span class="selectRequiredMsg">Please select an item.</span></span></span></p></td>
          </tr>
          <tr>
            <td id="formcells6"><p id="dates">*Project Community:<span id="txt_ojcommunity">
              <label for="projcommunity"><br />
              </label>
              <select name="projcommunity" id="projcommunity">
                <option value="1">.... Select from list ....</option>
                <?php
do { 
?>
                <option value="<?php echo $row_rsCommunity['community']?>"><?php echo $row_rsCommunity['community']?></option>
                <?php
} while ($row_rsCommunity = mysql_fetch_assoc($rsCommunity));
  $rows = mysql_num_rows($rsCommunity);
  if($rows > 0) {
      mysql_data_seek($rsCommunity, 0);
            $row_rsCommunity = mysql_fetch_assoc($rsCommunity);
?>
              </select>
            </span></p></td>
            <td id="formcells6"><p id="dates">*Project State:<span id="txt_projstate"><br />
              <select name="projstate" id="projstate">
                <option value="1">.... Select from list ....</option>
                <?php
do { 
?>
                <option value="<?php echo $row_rsState['state']?>"><?php echo $row_rsState['state']?></option>
                <?php
} while ($row_rsState = mysql_fetch_assoc($rsState));
  $rows = mysql_num_rows($rsState);
  if($rows > 0) {
      mysql_data_seek($rsState, 0);
            $row_rsState = mysql_fetch_assoc($rsState);
?>
              </select>
            </span></p></td>
          </tr>
          <tr>
            <td height="63" id="formcells8"><p id="dates">Project Cost:<span id="txt_projcost"><br />
              <label for="projcost"></label>
              <span id="txt_projectcost">
                <input name="projcost" type="text" id="projcost" />
                <span class="textfieldRequiredMsg">A value is required.</span></span></span></p></td>
            <td id="formcells"><p id="dates">*Project Type:<span id="txt_projtype"><br />
              <label for="projtype"></label>
              <select name="projtype" id="projtype">
                <option value="1">.... Select from list ....</option>
                <?php
do { 
?>
                <option value="<?php echo $row_rsType['projtypelist']?>"><?php echo $row_rsType['projtypelist']?></option>
                <?php
} while ($row_rsType = mysql_fetch_assoc($rsType));
  $rows = mysql_num_rows($rsType);
  if($rows > 0) {
      mysql_data_seek($rsType, 0);
            $row_rsType = mysql_fetch_assoc($rsType);
?>
              </select>
            </span></p></td>
          </tr>
          <tr>
            <td colspan="2" id="formcells2"><p id="dates">Project Baseline Data:<span id="sprytextarea2"><br />
              <label for="projbaselinedata"></label>
              <textarea name="projbaselinedata" id="projbaselinedata" cols="70" rows="8"></textarea>
            </span></p></td>
          </tr>
          <tr>
            <td colspan="2" id="formcells3"><p id="dates">Expected Outcome Of Project:<span id="sprytextarea3"><br />
              <label for="Projexpoutcome"></label>
              <textarea name="Projexpoutcome" id="Projexpoutcome" cols="70" rows="8"></textarea>
            </span></p></td>
          </tr>
        </table>
        <table width="600" border="0" cellpadding="0" cellspacing="0" id="teamtable">
          <tr>
            <td colspan="2"><strong id="subheaders">Beneficiaries</strong></td>
          </tr>
          <tr>
            <td width="241"><p>Adult Men Beneficiaries: <span id="txt_adultmen">
              <label for="adultmen"><br />
              </label>
              <input name="adultmen" type="text" id="adultmen" />
            </span></p></td>
            <td width="259"><p>Adult Female Beneficiaries:<span id="txt_adultfem"><br />
              <label for="adultfem"></label>
              <input name="adultfem" type="text" id="adultfem" />
            </span></p></td>
          </tr>
          <tr>
            <td><p>Adult Children Beneficiaries:<span id="txt_totalchildren"><br />
              <label for="children"></label>
              <input name="totalchildren" type="text" id="totalchildren" />
            </span></p></td>
            <td><p>Total Beneficiaries:<span id="sprytextfield4"><br />
              <label for="totalben"></label>
              <input name="totalben" type="text" id="totalben" readonly="readonly" />
            </span></p></td>
          </tr>
          <tr>
            <td><p> </p></td>
            <td><p> </p></td>
          </tr>
          <tr>
            <td><strong id="subheaders">Project Team</strong></td>
            <td><p> </p></td>
          </tr>
          <tr>
            <td><p>*Project Team Leader:<span id="spryselect1"><br />
              <label for="projteamlead"></label>
              <select name="projteamlead" id="projteamlead">
                <option value="1">.... Select from list ....</option>
                <?php
do { 
?>
                <option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
                <?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
  $rows = mysql_num_rows($rsProjectTeam);
  if($rows > 0) {
      mysql_data_seek($rsProjectTeam, 0);
            $row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
              </select>
            </span></p></td>
            <td><p>*Deputy Team Leader:<span id="spryselect2"><br />
              <label for="projteamlead"></label>
              <select name="projdepteamlead" id="projdepteamlead">
                <option value="1">.... Select from list ....</option>
                <?php
do { 
?>
                <option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
                <?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
  $rows = mysql_num_rows($rsProjectTeam);
  if($rows > 0) {
      mysql_data_seek($rsProjectTeam, 0);
            $row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
              </select>
            </span></p></td>
          </tr>
          <tr>
            <td><p>*Project Officer:<span id="spryselect3"><br />
              <label for="projteamlead"></label>
              <select name="projofficer" id="projofficer">
                <option value="1">.... Select from list ....</option>
                <?php
do { 
?>
                <option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
                <?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
  $rows = mysql_num_rows($rsProjectTeam);
  if($rows > 0) {
      mysql_data_seek($rsProjectTeam, 0);
            $row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
              </select>
            </span></p></td>
            <td><p>*Liason Officer:<span id="spryselect4"><br />
              <label for="projteamlead"></label>
              <select name="projliasonofficer" id="projliasonofficer">
                <option value="1">.... Select from list ....</option>
                <?php
do { 
?>
                <option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
                <?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
  $rows = mysql_num_rows($rsProjectTeam);
  if($rows > 0) {
      mysql_data_seek($rsProjectTeam, 0);
            $row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
              </select>
            </span></p></td>
          </tr>
        </table>
        <table width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="300" id="moredetails2"> </td>
            <td width="300"> </td>
          </tr>
          <tr id="moredetails">
            <td width="300" id="moredetails"><strong id="subheaders">Meeting Dates</strong></td>
            <td width="300"><strong id="subheaders">Other Dates</strong></td>
          </tr>
          <tr id="formrows">
            <td width="300" id="formrows"><p id="dates">*1st  Meeting Date: <em>YYYY/MM/DD</em><span id="txt_projmeeting1"><br />
              <input type="text" name="projmeeting1" id="projmeeting1" />
            </span></p></td>
            <td width="300" id="formrows"><p id="dates">*Project Start Date: <em id="formcells">YYYY/MM/DD</em><span id="txt_projstartdate">
              <label for="projstartdate"></label>
              <input type="text" name="projstartdate" id="projstartdate" />
              </span>
              <label for="projstartdate"></label>
            </p></td>
          </tr>
          <tr>
            <td width="300" id="formrows"><p id="dates">*2nd  Meeting Date: <em>YYYY/MM/DD</em><span id="txt_projmeeting2"><br />
              <input type="text" name="projmeeting2" id="projmeeting2" />
              </span>
              <label for="projteam2"></label>
              <label for="projmeeting2"></label>
            </p></td>
            <td width="300" id="formrows"><p id="dates">*Project End Date: <em>YYYY/MM/DD</em><span id="txt_projenddate"><br />
              <label for="projenddate2"></label>
              <input type="text" name="projenddate" id="projenddate" />
            </span></p></td>
          </tr>
          <tr>
            <td width="300" id="formrows"><p id="dates">*3rd Meeting Date: <em>YYYY/MM/DD</em><span id="txt_projmeeting3"><br />
              <input type="text" name="projmeeting3" id="projmeeting3" />
            </span></p></td>
            <td width="300" id="formrows"><p id="dates">*MoU Signing Date: <em id="formcells">YYYY/MM/DD</em><span id="txt_projmousigndate"><br />
              <label for="projmousigndate"></label>
              <input type="text" name="projmousigndate" id="projmousigndate" />
            </span></p></td>
          </tr>
          <tr>
            <td colspan="2" id="formrows2"><div align="center" id="notice"><img src="images/notice.jpg" width="501" height="73" /></div></td>
          </tr>
        </table>
      </div>
      <p align="center"></p>
      <p align="center" id="text">
        <input type="file" name="file_upload" />
        <input type="file" name="file_uploadone" />
        <input type="file" name="file_uploadtwo" />
      </p>
      <p align="center" id="text">
        <input type="file" name="file_uploadthree" />
        <input type="file" name="file_uploadfour" />
        <input type="file" name="file_uploadfive" />
      </p>
      <p align="center">
        <input type="submit" name="submit" value="Save &amp; Submit"/>
      </p>
    </form>
The addnew.php will now execute and add the data and image file names and path to MySQL database and upload the images to their various locations. it will also check the image file size be sure its not more than 100kb and must really be an iamge with format .jpg, .png and .gif.
<?php
if(isset($_POST['submit']))
          $projcode=$_POST['projcode'];
          $projname=$_POST['projname'];
          $projname=$_POST['projname'];
          $projdesc=$_POST['projdesc'];
          $projappdate=$_POST['projappdate'];
          $projcommunity=$_POST['projcommunity'];
          $projlga=$_POST['projlga'];
          $projstate=$_POST['projstate'];
          $projcost=$_POST['projcost'];
          $projtype=$_POST['projtype'];
          $projbaselinedata=$_POST['projbaselinedata'];
          $Projexpoutcome=$_POST['Projexpoutcome'];
          $adultmen=$_POST['adultmen'];
          $adultfem=$_POST['adultfem'];
          $totalchildren=$_POST['totalchildren'];
          $totalben=$_POST['totalben'];
          $projteamlead=$_POST['projteamlead'];
          $projdepteamlead=$_POST['projdepteamlead'];
          $projofficer=$_POST['projofficer'];
          $projliasonofficer=$_POST['projliasonofficer'];
          $projmeeting1=$_POST['projmeeting1'];
          $projmeeting2=$_POST['projmeeting2'];
          $projmeeting3=$_POST['projmeeting3'];
          $projmousigndate=$_POST['projmousigndate'];
          $projstartdate=$_POST['projstartdate'];
          $projenddate=$_POST['projenddate'];
          $name=basename($_FILES['file_upload']['name']);
          $t_name=$_FILES['file_upload']['tmp_name'];
          $dir='imageone';
          // Validate uploaded image file
          if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_upload']['type']) ) {
                       die('<p>Only browser compatible images allowed</p></body></html>');
          } else if ( $_FILES['file_upload']['size'] > 100000 )
                       die('<p>Sorry file too large</p></body></html>');
          if(move_uploaded_file($t_name,$dir."/".$name))
                    echo 'File 1 uploaded successfully....!';
          else
                    echo 'File 1 upload failed or was not submitted....!  ';
          $nameone=basename($_FILES['file_uploadone']['name']);
          $t_name=$_FILES['file_uploadone']['tmp_name'];
          $dir='imagetwo';
          // Validate uploaded image file
          if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadone']['type']) ) {
                       die('<p>Only browser compatible images allowed</p></body></html>');
          } else if ( $_FILES['file_uploadone']['size'] > 100000 )
                       die('<p>Sorry file too large</p></body></html>');
          if(move_uploaded_file($t_name,$dir."/".$nameone))
                    echo 'File 2 was uploaded successfully....!';
          else
                    echo '...File 2 upload failed or was not submitted!  ';
          $nametwo=basename($_FILES['file_uploadtwo']['name']);
          $t_name=$_FILES['file_uploadtwo']['tmp_name'];
          $dir='imagethree';
          // Validate uploaded image file
          if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadtwo']['type']) ) {
                       die('<p>Only browser compatible images allowed</p></body></html>');
          } else if ( $_FILES['file_uploadtwo']['size'] > 100000 )
                       die('<p>Sorry file too large</p></body></html>');
          if(move_uploaded_file($t_name,$dir."/".$nametwo))
                    echo 'File 3 uploaded successfully';
          else
                    echo '...File 3 upload failed or was not submitted!  ';
          $namethree=basename($_FILES['file_uploadthree']['name']);
          $t_name=$_FILES['file_uploadthree']['tmp_name'];
          $dir='imagefour';
          // Validate uploaded image file
          if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadthree']['type']) ) {
                       die('<p>Only browser compatible images allowed</p></body></html>');
          } else if ( $_FILES['file_uploadthree']['size'] > 100000 )
                       die('<p>Sorry file too large</p></body></html>');
          if(move_uploaded_file($t_name,$dir."/".$namethree))
                    echo 'File 4 uploaded successfully';
          else
                    echo '...File 4 upload failed or was not submitted!  ';
          $namefour=basename($_FILES['file_uploadfour']['name']);
          $t_name=$_FILES['file_uploadfour']['tmp_name'];
          $dir='imagefive';
          // Validate uploaded image file
          if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadfour']['type']) ) {
                       die('<p>Only browser compatible images allowed</p></body></html>');
          } else if ( $_FILES['file_uploadfour']['size'] > 100000 )
                       die('<p>Sorry file too large</p></body></html>');
          if(move_uploaded_file($t_name,$dir."/".$namefour))
                    echo 'File 5 uploaded successfully';
          else
                    echo '...File 5 upload failed or was not submitted!  ';
          $namefive=basename($_FILES['file_uploadfive']['name']);
          $t_name=$_FILES['file_uploadfive']['tmp_name'];
          $dir='imagesix';
          // Validate uploaded image file
          if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadfive']['type']) ) {
                       die('<p>Only browser compatible images allowed</p></body></html>');
          } else if ( $_FILES['file_uploadfive']['size'] > 100000 )
                       die('<p>Sorry file too large</p></body></html>');
          if(move_uploaded_file($t_name,$dir."/".$namefive))
                    echo '    File 6 uploaded successfully';
          else
                    echo '....File 6 upload failed or was not submitted!  ';
          mysql_select_db ($database_XXXXXXXX,$XXXXXXXX); where XXXXXXXX is my database connection details. Please change to yours.
                    $qur=("insert into tbl_projects (projid, projcode, projname, projdesc, projappdate, projcommunity, projlga, projstate, projcost, projtype, projbaselinedata, Projexpoutcome, adultmen, adultfem, totalchildren, totalben, projteamlead, projdepteamlead, projofficer, projliasonofficer, projmeeting1, projmeeting2, projmeeting3, projmousigndate, projstartdate, projenddate, name, path, nameone, pathone, nametwo, pathtwo, namethree, paththree, namefour, pathfour, namefive, pathfive) VALUES ('', '$projcode','$projname','$projdesc', '$projappdate', '$projcommunity', '$projlga', '$projstate', '$projcost', '$projtype', '$projbaselinedata', '$Projexpoutcome', '$adultmen', '$adultfem', '$totalchildren', '$totalben', '$projteamlead', '$projdepteamlead', '$projofficer', '$projliasonofficer', '$projmeeting1', '$projmeeting2', '$projmeeting3', '$projmousigndate', '$projstartdate', '$projenddate','$name','imageone/$name','$nameone','imagetwo/$nameone', '$nametwo', 'imagethree/$nametwo', '$namethree', 'imagefour/$namethree', '$namefour', 'imagefive/$namefour', '$namefive', 'imagesix/$namefive')");
                    $res=mysql_query($qur,$XXXXXXXX);
?>
Thank you. Hope this helps all those that are learning
Message was edited by: Prince Mike

Similar Messages

  • Steps of adding file uploader in dreamweaver 8.

    Hi, I have made a form in php that sends information to the server. I want the form to send files in PDF and word as well. Could someone direct me to steps of adding the file uploader using Dreamweaver 8?

    You would need to be pretty skillful in PHP to accomplish this - if you are, then I suggest you just Google "PHP file upload". If you are not, then you would need to look for an uploader extension - start at http://www.dmxzone.com for the best.
    By the way, you know how decrepit DW8 is, right?

  • Image / file upload error         cannot upload image even after setting write permissions

    Hi there everyone
    I am having this problem when I try to upload a file (image file) to my server
    I have a dynamic for working fine , all the other fields insert the information ok then I try to add an image upload behaviour to a file field
    When I try to upload the file I get this error
    Error:
    An error occurred while inserting the records.
    File upload error: File upload error. Error creating folder..
    File upload error. Internal error.
    Developer Details:
    tNG_multipleInsert error.
    An error occurred while inserting the records. (MINS_ERROR)
    File upload error: PHP_UPLOAD_FOLDER_ERROR
    File Upload Error. No write permissions in "../../productimages/" folder.
    (FILE_UPLOAD_ERROR)
    So I login to my server and change the write permissions to 777 and then try again and get the same message
    I have closed DW and tried again and still get the same message......
    I think I have followed all the steps correctly..... I have done the same type of forms many time and tested them locally on WAMP testing server and all work ok......
    So..... Anyone got any ideas
    Any help would be great
    Have a nice day

    On 5/17/07 4:26 PM, in article [email protected],
    "Gü[email protected]" <> wrote:
    >
    > To my experience servers behave differently -- on some I really had to use
    > 777, others are happy with 755.
    >
    > in regards to "any user" :: On most ADDT respectively MX Kollection - based
    > backends I made the image & file upload feature available to user having e.g.
    > the "levels" 1 & 2, but not 3 -- I wouldn´t expose something like this to all
    > users
    >
    > Günter Schenk
    > Adobe Community Expert, Dreamweaver
    My backend is only for admin, so they are the only ones who can access the
    upload pages. My concern is an images folder on the site being 777. Can't
    anyone from the outside plant a file in that folder if they just know where
    to find it using an ftp program? ?

  • File Upload using Flex/ColdFusion.  2044 error

    I am looking for a little more clarity around the file upload using Flex and Cold Fusion.  When I run this using my server I get Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
    I did create a regular cfform and had it use my ColdFusion upload form and that worked fine, so I feel good about the upload form. I am starting to think there is a permission error with the Flash Player writing to the folder.  When this is ran, it will show the file being 100% loaded but the complete event is never triggered.  I put alerts to see where it hits and 100 does show at the same time as my error message.  The complete alert never shows.  I also put an alert in my cfm page and it never reaches that page to hit it.  Whether I use an absolute URL or relative path. I have also tried the urlrequestmethod.post and nothing changed.  Thanks in advance.  BTW.  I am using Flex 3.
    This is my mxml file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:example="com.example.*" horizontalAlign="center" viewSourceURL="srcview/index.html">
    <mx:Script>
    <![CDATA[
    import com.example.FileDownload 
    import mx.controls.Label 
    import com.example.FileUpload]]>
    </mx:Script>
    <mx:Label id="title" text="File I/O Example" fontSize="24" fontStyle="bold" />
    <mx:Text id="subtitle" text="From Programming ActionScript 3.0, Chapter 22: Networking and communication" width="100%" textAlign="center" fontSize="12" /><example:FileDownload 
    id="fileDownload" creationComplete="fileDownload.init(downloadProgress, cancelDownload);" />
    <example:FileUpload id="fileUpload" creationComplete="fileUpload.init(uploadProgress, cancelUpload);" />
    <mx:HBox>
    <mx:Panel title="Upload File" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
    <mx:ProgressBar id="uploadProgress" label="" mode="manual" />
    <mx:ControlBar horizontalAlign="right">
    <mx:Button id="startUpload" label="Upload..." click="fileUpload.startUpload();" />
    <mx:Button id="cancelUpload" label="Cancel" click="fileUpload.cancelUpload();" enabled="false" />
    </mx:ControlBar>
    </mx:Panel>
    <mx:Panel title="Download File" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
    <mx:ProgressBar id="downloadProgress" label="" mode="manual" />
    <mx:ControlBar horizontalAlign="right">
    <mx:Button id="startDownload" label="Download..." click="fileDownload.startDownload();" />
    <mx:Button id="cancelDownload" label="Cancel" click="fileDownload.cancelDownload();" enabled="false" />
    </mx:ControlBar>
    </mx:Panel>
    </mx:HBox></mx:Application>
    here is my coldfusion upload script
    <!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>
    <script>alert('hello')</script>
    <cfset currentPath = getCurrentTemplatePath()>
    <cfset currentDirectory = getDirectoryFromPath(currentPath)>
    <cfoutput>This directory is #currentDirectory#</cfoutput>
    <cffile action="UPLOAD" filefield="Filefield" destination="#currentDirectory#" nameconflict="OVERWRITE"/>
    </body>
    </html>
    here is the package
    package  
    com.example { import flash.events.*; 
    import flash.net.FileReference; 
    import flash.net.URLRequest; 
    import flash.net.URLRequestMethod; 
    import mx.controls.Button; 
    import mx.controls.ProgressBar; 
    import mx.core.UIComponent; 
    import mx.controls.Alert; 
    public class FileUpload extends UIComponent { 
    // Hard-code the URL of the remote upload script. 
    private const UPLOAD_URL:String = "upload_script.cfm"; 
    private var fr:FileReference; 
    // Define reference to the upload ProgressBar component. 
    private var pb:ProgressBar; 
    // Define reference to the "Cancel" button which will immediately stop the upload in progress. 
    private var btn:Button; 
    public function FileUpload() {}
    /*** Set references to the components, and add listeners for the SELECT,
    * OPEN, PROGRESS, and COMPLETE events.
     public function init(pb:ProgressBar, btn:Button):void { 
    // Set up the references to the progress bar and cancel button, which are passed from the calling script. 
    this.pb = pb; 
    this.btn = btn; 
    fr =
    new FileReference();fr.addEventListener(Event.SELECT, selectHandler);
    fr.addEventListener(Event.OPEN, openHandler);
    fr.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    // fr.addEventListener(Event.COMPLETE, completeHandler); 
    /*** Immediately cancel the upload in progress and disable the cancel button.
     public function cancelUpload():void {fr.cancel();
    pb.label =
    "UPLOAD CANCELLED";btn.enabled =
    false;}
    /*** Launch the browse dialog box which allows the user to select a file to upload to the server.
     public function startUpload():void {fr.browse();
    /*** Begin uploading the file specified in the UPLOAD_URL constant.
     private function selectHandler(event:Event):void { 
    var request:URLRequest = new URLRequest(UPLOAD_URL); 
    /* request.url = UPLOAD_URL*/request.method = URLRequestMethod.POST;
     try  
    {fr.upload(request);
    }catch (error:Error){
    trace  
    ("error uploading")}
     /*** When the OPEN event has dispatched, change the progress bar's label
    * and enable the "Cancel" button, which allows the user to abort the
    * upload operation.
     private function openHandler(event:Event):void {pb.label =
    "UPLOADING";btn.enabled =
    true;}
    /*** While the file is uploading, update the progress bar's status and label.
     private function progressHandler(event:ProgressEvent):void {pb.label =
    "UPLOADING %3%%";pb.setProgress(event.bytesLoaded, event.bytesTotal);
    if(event.bytesLoaded==event.bytesTotal){ 
    trace(Event.COMPLETE)Alert.show(
    "100")}
    /*** Once the upload has completed, change the progress bar's label and
    * disable the "Cancel" button since the upload is already completed.
     private function completeHandler(event:Event):void {Alert.show(
    "in function")pb.label =
    "UPLOADING COMPLETE";pb.setProgress(0, 100);
    btn.enabled =
    false;}

    Presumably you need to add a result handler to your request.

  • Errors installing web service to use dreamweaver extension

    Portal Version: 10g
    OS/Vers. Where Portal is Installed:: Linux AS 2.1
    Errors installing web service to use dreamweaver extension
    Recently I download the dreamweaver extension for portal, but when I try to install it several errors are raised... in the installation guide the next message appear:
    This installation for this feature is an easy 3 step procedure.
    1. Installing the Portal web service
    2. Configuring the web service to work with your portal (one time administrative process)
    3. Installing the PortalTemplates extension for Dreamweaver MX
    well but when I try to run the 1 step everything goes wrong...
    in the guide say:
    # Transfer this file to the OC4J_HOME/j2ee/home directory of the OC4J
    (please make sure that the OC4J is up and running)
    # Use the following command to install the web service
    java -jar admin.jar ormi://<oc4j_host>:<oc4j_ormi_port>
    <username> <password>
    -deploy -file portalTemplate.ear -deploymentName portalTemplate
    here it's where I have some questions,
    1. the ormi referers to the rmi ok (I think that), well then I go tho the iasconsole and search for the ports and is show:
    home RMI 3202
    OC4J_Portal RMI 3203
    OC4J_BI_Forms RMI 3204
    then I use the home-> port 3202
    java -jar admin.jar ormi://myhost.midtierinstall.com:3202
    ias_admin ias_midtier_admin_password -deploy -file portalTemplate.ear -deploymentName portalTemplate
    but the following messages appear :
    Error: Unable to find java:ServerAdministrator : lookup error:javax.naming.AuthenticationException invalid username/passwod for default (ias_admin).... and the error continue... but the problem is that the password works when I use the enterprise manager in that midtier console...
    I want to know if I'm doing something wrong or how I should use this command to install that web service

    The ormi is the rmi port in the OC4J. This coold be found in oc4j_home/j2ee/home/config/rmi.xml file. The default port is 23791.
    Hope this helps,
    Ramya

  • File uploads using servlets to oracle8i database

    Hi,
    Help please, How I can a File Upload using BLOB's into the oracle database, any sugestions...
    Thanks
    Moacyr
    [email protected]

    Try the jason hunter book Java Servlet Programming for a very good description or the web site hosted by o'reilly
    www.servlets.com
    Has a very neat java class for decoding multipart mime encoded files (the upload stream from the browser). Seems to accomodate most of the differing browsers intretation of the standard.
    Note to Oracle: This should really be handled by the servlet engine as an Oracle extension. Where the servlet engine strips the mime encoding out before the servlet is called placing the decoded file in an associated extension call. ie: cast the request to an Oracle request object which has file uploaded method.

  • File uploads using jQuery with jquery.fileupload.js fails in Firefox over SSL

    Please see the link below where I originally posted the question.
    http://stackoverflow.com/questions/27792614/file-uploads-using-jquery-with-jquery-fileupload-js-fails-in-firefox-over-ssl

    Thanks. In my estimation that is exactly the issue. But that doesn't help with a resolution.
    The actual file size: 945,991 bytes
    If Firefox is miscalculating the length (in Safari/Chrome 945991 and 946241 in Firefox), then Firefox is reporting erroneously and should be raised as a bug in Firefox, would you agree?

  • URGENT.........File Upload using Servlets and jsp

    I am a new servlet programmer.......
    iam using tomcat server......
    can any one pls help in writing code for file upload using servlets and jsp without using multipart class or any other class like that....
    Please URGENT..

    Slow down! "Urgent" is from your perspective alone. I, myself, am not troubled or worried in the least.
    hi ugniss
    thanks for ur reply....sorry i was not
    y i was not asked not to use multipart class or any
    other class like that...is there any other
    possibility to do file uploading from jsp to
    servlet...
    Just as an aside, a JSP is a Servlet. But even if I move beyond that, the question does not make sense. If you want a "JSP to upload to a Servlet", then simply do so in memory. You are still (likely) within the same scope of a given request. However, if instead you are referring to a JSP that is displayed on a browser, then really you are talking about HTML, which is what the browser will receive. And since you are now talking about a browser, your only real, viable option is a multi-part file upload. So, it is either server or it is browser. And either way, the question leads to very established options, as outlined above.
    the main concept is.. in the browser the user selects
    a particular file and clicks the button upload..after
    clicking upload the jsp should sent the file to the
    servlet in streams...there the servlet gets in and
    saves in a server location........this is wat i hav
    to do...
    Okay. So, after reading my previous (redundant) paragraph, we have arrived at the crux of the issue. You have a JSP that will be output as HTML to a client (browser) which you want to upload content to your server (handled by a Servlet). So, you are now stuck again with multi-part. The requirement to not use multi-part is non-sensical. You can overcome it, say, if you write your own applet or standalone Swing client. However, if your users are invoking this functionality from a browser, you are limited by the options that W3C has provided you. Use multi-part.
    is there aby possibilty to do this.....can any one
    pls help....Take the advice to download and review Jakarta Commons FileUpload. Inform your management that their requirement makes no technical sense. Research on your own. There are dozens of examples (and tutorials) on file upload using multi-part. Embrace it. Live it. Love it.
    - Saish

  • HTML File Upload - using DAD - Error

    I have set up my document table, the document upload package is in there, but my HTML for the file upload is not working correctly:
    DAD info
    DAD Name: /pls/portal
    Document Table: dw_target.documents
    Document Access Procedure: document_api.download
    here is the upload HTML:
    <html>
    <head>
    <title>test upload</title>
    </head>
    <body>
    <form enctype="multipart/form-data" action="http://MYURL:7777/portal/pls/portal/dw_target.document_api.download" method="post">
    File to upload: <input type="file" name="file"><br>
    <input type="submit" value="Upload">
    </form>
    </body>
    </html>
    But i get this error when i try to upload a doc:
    The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
    anyone have any insight on how to get the file upload to work (specifically how to configure the HTML to correctly use the upload process?
    using Oracle App Server 10g
    jason

    Pschar,
    What is "dw_target.documents"?
    Joel

  • Error in File uploading using jsp

    I am tring to upload files to a mysql database using jsp.I have used BLOB type to store files.Iam using the JDBC driver mysql-connector-java-2.0-14-bin to connect the database with the jsp API.My problem is when i try to transfer a file of size which is less than the possible capacity through blob ,which is 1048576 bytes ( for example when a file of size 916KB is attempted to transfer) the following error is being generated.
    java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet from server configuration of 1048576 bytes
         at com.mysql.jdbc.Buffer.ensureCapacity(Unknown Source)
         at com.mysql.jdbc.Buffer.writeBytesNoNull(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at org.apache.jsp.file3$jsp._jspService(file3$jsp.java:110)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)
    java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet from server configuration of 1048576 bytes
         at com.mysql.jdbc.Buffer.ensureCapacity(Unknown Source)
         at com.mysql.jdbc.Buffer.writeBytesNoNull(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at org.apache.jsp.file3$jsp._jspService(file3$jsp.java:110)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)
    My uploading code in jsp is as follows.
         <% try{
              Class.forName("org.gjt.mm.mysql.Driver").newInstance();
              Connection dbCon = DriverManager.getConnection("jdbc:mysql:///uoc");
              out.println("Connection done !");
              Statement stmt = dbCon.createStatement();
              out.println("Statement Created !");
    ResultSet rs = stmt.executeQuery("SELECT * FROM blob_test)
    stmt.close();
    dbCon.close();
    out.println("<br><br> <b>Data Successfully selected !<b>");
    } //try
    catch(SQLException e){
         out.println(" <br> ");
         out.println("Sorry ! problem in selecting a data "+e.toString());
         out.println(" <br> ");
                   e.printStackTrace();
    %>
    Please help .I thank You in advance for any help .

    Have you tried increasing the BLOB field greater than 1048576 or using a smaller file of say 1 or 2k as a test? There is no guarantee that the database will store the file with exactly the same size as the file on the filesystem, so the file might be more than 916k in the database.
    Using BLOBs is a great way to destroy the performance of your database by the way :)

  • Keep Getting Annoying Image/File Upload Error Please Help!

    I keep getting this error message - can't upload image X.png, it seems to happen with several different image - then I try to resume/retry wait some time; sometimes it works and sometimes it doesn't, getting kind of frustrating.  Please help!
    http://chefagogo.businesscatalyst.com/

    Hi
    Are you still facing the same issue ?
    It can be due to few reasons such as connectivity issues or if any update to your site is done at the same time from BC end.
    If still you are facing same error, please let me know.
    Thanks,
    Sanjit

  • File Upload using Tomcat 5.x Apache 2.x

    Hi,
    Once I updated my tomcat 5.x to apache 2.x and ran my upload jsp code using java api i wrote to upload file to server, all pictures or videos received seems distorted.. At first i thought of bit shift or something but when i upload a textfile all look right.. Anyone know what the heck is going on before i disect my code.
    thanks
    henry

    make sure your modjk logs don't have any errors.
    Here's a peice out of my httpd.conf
    #ADDed Oct 15,2003, seemed to remove modjk error
    AddType multipart/form-data .gif .png  .jpg .peg .jpeg .jpeI used to get strange modjk logged errors.
    Also did you compile jk2 from source???
    com.oreilly.servlet --- cos
    http://www.servlets.com/cos/index.html
    http://www.servlets.com/cos/cos-05Nov2002.zip
    But if my bit shift is correct wouldn't my regular textfile upload be distored?From what I remember, the problem is something to do with logical AND or OR, with the bits. Apache receives it fine, passess it through jk, and and either the most sig or least gets lost. Image data is critical as every bit counts, text file, you may not notice it(white space), or every nTH file upload might fail.
    here are the version numbers of software I use, and have compiled all from source.
    apache-httpd-2.0.47
    tomcat-4.1.27
    jk2-connectors-2.0.2

  • File Upload using PRC API's

    Guys,
    I am trying to upload a new document using PRC API's. Below is required code snippet that i am using.
    IRemoteDocument remoteDoc = documentManager.createRemoteDocument(folderID,dataSourceID,document.getPath()); remoteDoc.setOverrideName(document.getName()); remoteDoc.setOverrideDescription(document.getDescription()); remoteDoc.setType("http://www.plumtree.com/dtm/mime", document.getFileType());int docID = -1;docID = remoteDoc.save();
    dataSourceID - ID of my file upload datasource , document - is my java object which has all the document related properties such as , name , description , MIME type of document etc..Below is different document path's(scenarios) that I have triedc:\work\sample.txt\\servername\work\sample.txthttp:\\appserver:7001\appName\uploadfiles\sample.txt
    When I execute this code from my application i get a below error.
    com.plumtree.remote.prc.PortalException: null; nested exception is: java.rmi.RemoteException: Error in function PTDataSource.ImportDocument(vDocumentLocationBagAsXML == '<?xml version="1.0" encoding="ucs-2"?><PTBAG V="1.1" xml:space="preserve"><I N="PTC_DTM_SECT">1001</I><S N="PTC_DOC_ID">application/msword</S><S N="PTC_UNIQUE">\\PHUSEH-L33664.NA.novartis.net\work\sample.doc</S></PTBAG>', lDocumentTypeID == 100, pCard == com.plumtree.server.impl.directory.PTCard@c27b6f, bSummarize == false, pProvider == null): Error in function PTDataSource.ImportDocument (vDocumentLocationBagAsXML == <?xml version="1.0" encoding="ucs-2"?><PTBAG V="1.1" xml:space="preserve"><S N="PTC_DOC_ID">application/msword</S><I N="PTC_DTM_SECT">1001</I><S N="PTC_UNIQUE">\\PHUSEH-L33664.NA.novartis.net\work\sample.doc</S></PTBAG>, lDocumentTypeID == 100, pCard == com.plumtree.server.impl.directory.PTCard@c27b6f, bSummarize == false, pProvider == null): SOAP fault: faultcode='soapenv:Server.userException' faultstring='java.lang.NullPointerException' at com.plumtree.remote.prc.DocumentWrapper.save()
    Below is my environment.Plumtree is running on Weblogic 8.1 (Solaris OS) , ptupload webservice is running on weblogic8.1 solaris,My upload document portlet is running on weblogic 8.1 (Windows OS)
    If anyone has any working sample code please send it to my ID [email protected] or else please upload it here.Thank You ,
    Dan.

    make sure your modjk logs don't have any errors.
    Here's a peice out of my httpd.conf
    #ADDed Oct 15,2003, seemed to remove modjk error
    AddType multipart/form-data .gif .png  .jpg .peg .jpeg .jpeI used to get strange modjk logged errors.
    Also did you compile jk2 from source???
    com.oreilly.servlet --- cos
    http://www.servlets.com/cos/index.html
    http://www.servlets.com/cos/cos-05Nov2002.zip
    But if my bit shift is correct wouldn't my regular textfile upload be distored?From what I remember, the problem is something to do with logical AND or OR, with the bits. Apache receives it fine, passess it through jk, and and either the most sig or least gets lost. Image data is critical as every bit counts, text file, you may not notice it(white space), or every nTH file upload might fail.
    here are the version numbers of software I use, and have compiled all from source.
    apache-httpd-2.0.47
    tomcat-4.1.27
    jk2-connectors-2.0.2

  • How to get full path of a file uploaded using file control on a jsp ?

    Hi all...
    I have a jsp on which i am using a file element (input type="file") to upload files present on the physical file system.. Thats working fine.. But i want to retrieve the full path of the file uploaded for further computation.
    What are the possible ways which can give me the full path ?? (e.g. "D:\data\text\Output.txt" )
    Thanks all for attending the question..
    Regards
    Prasad

    Some browsers send the full path. Some do not.
    You can not affect this in any way shape or form.
    All you can count on receiving is a filename - no path information.
    So you will have to have some other way for the user to pass along this information.
    If they are uploading to a "remote web site" they could specify a folder to put the uploaded file in.
    You could classify it and put all image files in "images" and all script files in "scripts" etc etc by default, and let the user deal with it in their own HTML.
    Hope this helps,
    evnafets

  • File Uploads using stored procedures

    Hello, I'm quite new here, but I have a question that I've been butting my head against for the past day. Here goes.
    We need to upload a file using a stored procedure (PL/SQL procedure.)
    The two things I have found that work are
    1) Having oracle do the file handling (using bfiles) in the procedure
    2) using an insert statement directly to upload the file contents into a blob.
    The platform is php (Oracle instant client) and I will show some code examples.
    1) is unworkable because Oracle will not have direct access to any files.
    2) is fine, but we would prefer to use a procedure so as to abstract what exactly goes on and possibly other operations away from the php and the framework.
    What worked:
    1)
    CREATE OR REPLACE PROCEDURE php_upload_file (file_name in varchar2, canonical_name in varchar2, owner in number, file_id IN OUT number)
    AS
    src_loc bfile:= bfilename('DOC_LOC',php_upload_file.file_name);
    dest_loc BLOB;
    begin
    insert into files values(owner,canonical_name,empty_blob(),files_seq.nextval) returning files.data, files.file_id
    into dest_loc, file_id;
    dbms_lob.open(src_loc,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(
    dest_lob => dest_loc
    ,src_lob => src_loc
    ,amount => DBMS_LOB.getLength(src_loc));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_loc);
    COMMIT;
    end;
    'DOC_LOC' is a directory I've set up that the user has access to.
    Interfacing with PHP this just looks like
    oci_parse($conn,"BEGIN php_upload_file('{$uploadfilename}','{$propername}',{$ownerid},:file_id); END;");
    Dead simple, right?
    I also do a bind command to pull out 'file_id' so I know the id that was just inserted.
    The other solution is
    $contents = file_get_contents($_FILES["uploadedfile"]["tmp_name"]);
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
    $stmt = oci_parse($conn,
    "INSERT INTO files (employee_id, filename, data, file_id) VALUES(175,'"
    .$_FILES["uploadedfile"]["name"].
    "', empty_blob(), files_seq.nextval) RETURNING file_id, files.data INTO :file_id, :src_contents");
    where :src_contents is binded to a lob and :file_id as before is binded to an INT:
    oci_bind_by_name($stmt, ':src_contents', $lob, -1, OCI_B_BLOB);
    oci_bind_by_name($stmt, ':file_id', $insert_id, -1, SQLT_INT);
    oci_execute($stmt,OCI_DEFAULT);
    In this case the last thing I do before the commit is
    $lob->save($contents);
    Both work fine, but what I need is this
    $contents = file_get_contents($_FILES["uploadedfile"]["tmp_name"]);
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
    $stmt = oci_parse($conn,"BEGIN do_upload_file(:src_contents,'{$propername}',{$ownerid},:file_id); END;");
    oci_bind_by_name($stmt, ':src_contents', $lob, -1, OCI_B_BLOB);
    oci_bind_by_name($stmt, ':file_id', $insert_id, -1, SQLT_INT);
    oci_execute($stmt,OCI_DEFAULT);
    $lob->save($contents);
    oci_commit($conn);
    this omits error conditions (such as on $lob->save ... etc.) it is simplified.
    The content of the procedure I changed as follows, but it seems untestable.
    CREATE OR REPLACE PROCEDURE do_upload_file (src_contents IN OUT blob, canonical_name in varchar2, owner in number, file_id IN OUT number)
    AS
    dest_loc BLOB;
    begin
    insert into files values(owner,canonical_name,empty_blob(),files_seq.nextval) returning files.data, files.file_id
    into dest_loc, file_id;
    dbms_lob.open(src_contents,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.COPY(dest_lob => dest_loc,
    src_lob => src_contents
    ,amount => DBMS_LOB.getLength(src_contents));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_contents);
    COMMIT;
    end;
    I don't get errors because I cannot figure out a way to run this procedure in my PL/SQL environment with valid data. (I can run it with a blank blob.)
    But when I work out the order of what's going on, it doesn't make sense; the commit in the procedure is before the $lob->save(...) and thus it would never save the data... nonetheless it should at least create a record with an empty blob but it does not. What is wrong is beyond the error level that seems to be supported by PHP's oci_error function (unless I have not discovered how to turn all errors on?)
    In any case I think the logic is wrong here, but I'm not experienced enough to figure out how.
    To test it I would need to create a driver that loads an external file into a blob, and passes that blob into the procedure. Trouble is, even if I make a blob and initialize it with empty_blob() it treats it as an invalid blob for the purposes of the dbms_lob.copy procedure.
    If someone has solved this problem, please let me know. I would love to be able to do the file upload with just a single procedure.

    Thanks. In my estimation that is exactly the issue. But that doesn't help with a resolution.
    The actual file size: 945,991 bytes
    If Firefox is miscalculating the length (in Safari/Chrome 945991 and 946241 in Firefox), then Firefox is reporting erroneously and should be raised as a bug in Firefox, would you agree?

Maybe you are looking for

  • I am trying to install os x yosemite and it has frozen and nothing has happened for over a day now?

    I have been trying to download os x yosemite on to my macbook air version 10.9.5 since yesterday and its currently frozen at 870 MB. An error keeps appearing and starts to re download but nothing happends

  • Macbook Pro to Macbook Pro Retina

    Hi, i am having troubles with my Macbook Pro OS X 10.9.5 as the system perfomance is so slow and the applications have tendencies to crash all the time. Is there any way that I could sent it to Apple and actually upgrade it to a Macbook Pro Retina in

  • Help Zooming the 3D Sphere

    Hello Friends ... am pretty much new to Java 3D... my objective is to come up with a Sphere, add Mouse events to it & then wrap a texture around it.... with help from this forum, i have a SPhere in place, which rotates just fine.. am unable to add th

  • How to Configure ReturnAuthorizationNotification Form in Action Profile(CRM

    Hi All, I am trying to assign Return Authorization Notification (ZForm) in the CRM Transaction through Action Profile. It is asking for "Object Type Name", "Context Class" 'Processing Class" and "Processing Method" parameters. Can any one explain the

  • JOptionPane. problems

    i am trying to do a program. i need to accept two numbers using two seperate dialog box and then add these numbers and present the result using an another dialog box . i am a new user to java. can somebody please help me out. PLease