Data error _ Beginner_flat file upload

Hey there,
  I am a beginner and am trying to upload a flat file. My Info objects are Material Id, Material Name , Price[keyfigure]. Material Id will have Material Name and Price as attributes and is With Text.
For the Keyfigure, Price, I have selected Amount and defined as 0currency.
In the flat file, i have Material id, Material Name, Price, Currency, Description[ for Text], its something like this
Mid        M-Name     Price        Currency     DESCRIPTION
M1001     CAR             299.99        USD             SUV
When I create an Application Component and thereafter create a data source for master data attributes for Material
and select the flat file and upload it, then the data types for Keyfigure PRICE changes to FLTP Length 16, its no longer as DEC and i get something like
M1001     CAR     2.9999000000000001E+02     USD     SUV. Why am I having this problem and how could this be resolved ?
Well I know this might be a cakewalk for bunch of guys here but am just starting off so any sort of help and suggestions would be highly appreciated. Thanks guys, have a wonderful one.

@ francisco :
Hey,
        Thanks a lot for your valuable suggestion. I tried doing that but it didn't work either. The preview data looks like this
M1001     CAR     29,999     USD     SUV
Why should it be selected as Transactional Data ? I have selected 'With Text' , 'with Master data" for the Material Number and gave the Material Name and Price as Attributes in Material Number.
So there should be two data sources right, one for the Master data Attributes and another for Master Data Text ? how far am i correct.
Thanks again for your reply.

Similar Messages

  • Error in Flat files upload

    I have a week of history data and I am trying to upload it but I got this error;
    Error in conversion exit
    CONVERSION_EXIT_CUNIT_INPUT
    when I diagonis this error the detail tell me that:
    An error occurred in record                                                   1 during execution ofconversion exit CONVERSION_EXIT_CUNIT_INPUT for field ME_UN_ADSP.
    The actual field I am using is '0ME_UN_ADSP' in my Infosource. I have no idea. what's wrong. could anyone please explain me. Thank you.

    Hello everybody I have another error while loading Transactional Data CSV and ASCII in a transactional Info Cube. I get either Error 1, 4, or Error 8 after in the Schedule Tab the Start button is hit. I have BW 3.5, and well, this is the complete text for Error 1, yes I have checked that everything matches of what have been defined in the info catalogs and transfer rules, update rules, and communication structure.
    Again this is not a problem of format of data, since i have used the same file in other uploads, but not in BW 3.5, is there any patch that i need to apply?
    Error 1 when loading external data
    Message no. RSAR234
    Diagnosis
    Error number 1 occurred when loading external data:
    1. Error when reading the file (access rights, file name, ...)
    2. File size or number of records does not correspond to the data in the control file
    3. Error when generating the IDoc
    4. File contains invalid data (errors with an arithmetic operation or data conversion)
    Procedure
    Check whether you have the required access rights and whether the data in the control file is correct (file names, record length, number of records, ...). Correct the data in the control file if necessary and check the data file for invalid data (values of the wrong type, values in the wrong format for conversion exit,...). Check whether the file has headers that have not been specified.

  • Error while using File Upload through Frontend

    Hi,
    I need to upload an EXcel file , read the content and save the data to a db table. I used the
    <htmlb:fileUpload id = "FileUpload"
                                onUpload    = "HandleUpload"
                                upload_text = "Upload"
                         size        = "40"  />
    But while calling the function for clipboard
    CALL FUNCTION 'CLPB_IMPORT'
        TABLES
          data_tab   = excel_tab
        EXCEPTIONS
          clpb_error = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
        MESSAGE a037(alsmex).
      ENDIF.
    It is throwing the 'message a alsmex 037 cannot be processed in plugin mode https'. Can you pleas guide me how to rectify this problem. Is there a note for this?
    Regards,
    Shiny

    Hi Shiny,
    Did you ever come across a solution to this problem? I'm having the same issue myself.
    I have a function module that transfers the data from an excel file into database tables and when I try to call the FM from a BSP page I get the same error
    Message A ALSMEX 037 cannot be processed in plugin mode HTTP
    Just wondering if you ever solved this or found another way of uploading excel using BSP?
    Thanks,
    Darren

  • Error while during file upload in JSF

    Hi
    I do get this error while uploading a file in JSF .
    org.apache.myfaces.webapp.filter.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:134)
         at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.getParameter(MultipartRequestWrapper.java:163)
         at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:157)
         at com.sun.faces.context.RequestParameterMap.get(ExternalContextImpl.java:673)
         at jsf.PagePhaseListener.afterPhase(PagePhaseListener.java:18)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:211)
    Can anybody wat i must do

    thanks....
    but that answer is not solve my question. Actually i want to know.. can we develope a custom tag in JSF for file upload......

  • 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

  • Error handling for file upload

    HI Experts,
    I have a question on file upload process in sap MDG-S.
    Scenario : Upload the content from a CSV file using the file upload prcoess.
    Query : For example if there are 5 records in the file and if there is an error in 3rd record what happens to the rest of the records i.e. 1,2 and 3,4.
    a) Will record 1 and record 2 get posted and record 3,4 will be failed?
    b) All 4 records will not be posted as there is one errored record.
    Regards,
    Charita.

    Hi charitha,
    As per your request if there is a error in any of the record in a particular file it does'nt loads any of the fields to the target, it will be terminated  with an error.
    As i checked with an example of Space delimited file in which 4th field has no spaces, and i used this file as source and run the job it does'nt return any values but terminated with an error.
    let me know if i am right..
    Regards,
    Amjad

  • What's the error of this file-upload code?

    hi,
    I have written following code for file selection:
    <form action="display.jsp" method="POST" enctype="multipart/form-data">
    <input type="file" name="File1">
    <input type="submit" name = "button" value="Submit">
    </form>And my project another file display.jsp which code is:
    <%@ page import="org.apache.commons.fileupload.*"%>
    <%@page import="java.io.*" %>
    <%@page import="java.util.*" %>
    <%
         out.println("Content Type: "+request.getContentType());
         boolean isMultipart=FileUpload.isMultipartContent(request);
         DiskFileUpload upload=new DiskFileUpload();
         List items=upload.parseRequest(request);
         Iterator iter=items.iterator();
         while(iter.hasNext()){
              FileItem item=(FileItem)iter.next();
              if(item.isFormField()){
                   out.println("SIZE: "+item.getSize());
                File fNew= new File(application.getRealPath("/"), item.getName());
                 out.println(fNew.getAbsolutePath());
                item.write(fNew);
              else
         out.println("Field ="+item.getFieldName());
    %>After that, i put on common-fileupload-1.1..jar on the project's /WebConcontent/WEB-INF/lib/ directory. And i have also add the common--fileupload-1.1.1. jar in the project build path. Further that i have got following error:
    Error is:
    exception
    org.apache.jasper.JasperException: org/apache/commons/io/output/DeferredFileOutputStream
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.ServletException: org/apache/commons/io/output/DeferredFileOutputStream
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.display_jsp._jspService(display_jsp.java:78)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
         org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:102)
         org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
         org.apache.jsp.display_jsp._jspService(display_jsp.java:53)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Why i have got this error? IS there anybody can help me? What will be the solution?Please Help me?
    With regards
    Bina

    java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
    Means you are missing a class file from the class path. Most likely cause is a missing jar file. The Apache Commons utilities often have dependancies on other Commons projects. This looks like it is looking for the Apache Commons IO jar file. Download the jar file and add it to the WEB-INF/lib directory.

  • Database character set = UTF-8, but mismatch error on XML file upload

    Dear experts,
    I am having problems trying to upload an XML file into an XMLType table. The Database is 9.2.0.5.0, with the character set details:
    SELECT *
    FROM SYS.PROPS$
    WHERE name like '%CHA%';
    Query results:
    NLS_NCHAR_CHARACTERSET          UTF8     NCHAR Character set
    NLS_SAVED_NCHAR_CS          UTF8
    NLS_NUMERIC_CHARACTERS          .,     Numeric characters
    NLS_CHARACTERSET          UTF8     Character set
    NLS_NCHAR_CONV_EXCP          FALSE     NLS conversion exception
    To upload the XML file into the XMLType table, I am using the command:
    insert into XMLTABLE
    values(xmltype(getClobDocument('ServiceRequest.xml','UTF8')));
    However, I get the error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    Why does it mention UCS2, as can't see that on the Database character set?
    Many thanks for your help,
    Mark

    USC2 is known as AL16UTF16(LE/BE) by Oracle...
    Try using AL32UTF8 as the character set name
    AFAIK The main difference between Oracle's UTF8 and AL32UTF8 character set is that is the UTF8 character set does not support those UTF-8 characteres that require 4 bytes..
    -Mark

  • LSMW Errors for Excel file upload

    Hi all,
    We've loaded an Excel file with 20,000+ records into SAP using LSMW and a background run. However, the LSMW returned errors for about 2,000 of those records and seems to have processed the other 18,000. Questions as follows:
    1. Is there a way to extract the 2000 records into another Excel file?
    2. If so, how can I isolate the 2000 records so that I can reload them with correct information?  I do not want to have to go through each record one by one to find them.
    3. How can I identify what the problem was for a record that produced an error?
    Thanks in advance. Points will be awarded for helpful answers.

    u have used LSMW which will normally create a Session which will be executed using SM35 in background mode...Goto the session and click on errors...the errors are been shown up..U can correct there itself or else prepare another one with correct data and do a lsmw once again.

  • Error in flat file uploading

    Hi
    II upload a flat file with datas like "Order No" whitch is stored as De/12/Ce/1435, and "Date" stored as 1999-02-12. But when I look a preview I see "Order No" converted to number something like 000000001000000234 and "Date" is cut to only 1999-02-
    The file is a .csv separated with comas.
    After uploading it is in DSO and DAtaCube that way. How to solve that?

    Hi,
    The problem may be with the flat file. Just have only one record in the flat file. Open the CSV flat file in Notepad see what is the data displayed. If mappings are done correctly, the data displayed in notepad output will be loaded exactly into data target.
    Just try with one record.
    Regards
    Akhan

  • Error in flat file upload

    Dear All,
    I am uploading from a flat file source system and it give me an error saying IDOC type for sourcesystem is not available is this purely an basis problem or is there anything I can do about it.
    Thanks &Regards,
    Vinay.

    Hello,
    Check the Log in sm21 (for all servers). Did any short dumps reported for the failure (st22).
    what exactly is the error reported in RSMO?
    Please give us error in detail.
    Thanks and Regards,
    Harish

  • Does any one know how to resolve the error while flat file upload

    Hey guys, I am so struck with this problem, please do let me know if anyone has any suggestions and ideas.
    1. I created three InfoObjects, Material Number, Name and Price,which is  a keyfigure and has data type DEC and fixed currency USD.
    Material Number is "With Master Data ", "With Text" and i added Name and Price as attributes to that.
    2.
    After that i created an Application component, and therafter a data source for Master data Attibutes.
    Now i select my flat file which is .csv file, in this data source. When I click "Load Example Data", i get all the fields from flat file, but the data type for PRICE changes to FLTP with length 16 instead of remaining DEC.
    Does anyone have any idea why on earth is this change of Data type taking place ?
    Please do me a favour by answering if you know about this problem. Thanks, appreciate it . Byee. And yeah, m just starting off in SAP so I am a total amateur unlike most of the people here.

    Am workin on BI 7.0.
    Let me put it in another way :
    Created Infoobjects:      1) Material No , 2) Material Name  3 ) Price which is the Key Figure
    Material No -
    has attributes Material Name and Price and " WIth Master Data", With ' Text"
    Price: -
    data type DEC, fixed currency - USD
    After doing things.
    Created Application Component:
    then, Right Click - Create Data Source,
    Selected -- Master Data Attributes
    After that from "EXTRACTIO' tab , selected the flat file, which is *.csv
    and then in DATA FORMAT - " SEPERATED WITH SEPERATOR"
    Then from "PROPOSAL" tab, when i click Load example data, the data from flat file shows up here, but the field PRICE now has Data Type -- " FLTP" and lenght "16"
    I hope i was clear enough. thanks

  • File Upload: no error but don't work. Why?

    Hi all,
    i'm an application with a jsp for upload a file.
    I have the following code in my Action (extention of the DataForwardAction):
    // UploadForm extends org.apache.struts.action.ActionForm
    UploadForm uf = (UploadForm) ctx.getActionForm(); // ctx is DataActionContext
    FormFile ff = (FormFile) uf.getMyFile();
    log.warn("[onLoad] - ff: " + ff);
    but in the log file i found:
    2007-01-18 10:31:33,564 - ERROR (UploadFilePricesViewAction.java:194) - [onLoad] - ff:null
    No errors and not file uploaded.
    Anyone think a reason why this happen?
    Can you help me?
    I use ADF/Struts (no faces) with JDev 10.1.2 and Application Server 10.1.2.1
    Thanks a lot for any suggestion.
    Alessandro

    repost
    Please is very important
    Thanks

  • Excel data read from users and upload in to Oracle DB using custom webpart

    Hi Team,
    I need to get the excel date from user using file upload control and read the data from the excel using custom webpart and validate the each rows whether having the values or not and need to upload the data to the oracle database.
    Can you please let me know the best approach to read the data from excel using sharepoint custom webpart.
    Thanks,
    Mylsamy

    Hi,
    According to your post, my understanding is that you want to read excel data from the uploaded file and insert the data into Oracle Database.
    The following way for your reference:
    1.Create a Visual Web Part using Visual Studio.
    2. Add an asp.net upload control into the .ascx file.
    <div>
    <asp:FileUpload ID="fileupload" runat="server" />
    <asp:Button ID="btnUpload" runat="server" onclick="btnUpload_Click" Text="Upload" />
    </div>
    3. Add some logic methods into .ascx.cs file.
    protected void btnUpload_Click(object sender, EventArgs e)
    //read data and insert the data into Oracle database.
    4.We can create a web service for adding data to Oracle database, then consume this web service in the visual web part.
    More information:
    http://msdn.microsoft.com/en-us/library/ff597539(v=office.14).aspx
    http://manish4dotnet.blogspot.in/2013/02/upload-ans-read-excel-file-using-c.html
    http://msmvps.com/blogs/windsor/archive/2011/11/04/walkthrough-creating-a-custom-asp-net-asmx-web-service-in-sharepoint-2010.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • File upload problem. Can't write to server

    Hi guys,
    I am currently trying to upload some images to the server I am using but I can't succeed.
    I am using a form consisting of 3 text fields 1 textarea and an upload form.
    The whole thing is working fine on my localhost . All the items are being inserted to the database and the files saved to the path.
    But when I try to upload to the commercial server even though the text field are being read and inserted to database the files just can't!!
    my tree structure is
    /home/domain/www-domain/webapps
    and that's what I am getting when using
    getServletContext().getRealPaththe full line for getting the real path is
    FileWriter fw2 = new FileWriter(getServletContext().getRealPath("//upload"+fileName+".jsp")); I am using tomcat 4.0 and all the other servlets are working just fine
    as this one apart from the FileWriting thing?
    am I doing something wrong with the getServletContext thing?
    And if so, why is it working just fine on my pc?
    I am only suspecting that I am not getting the path correctly
    I want to store the images under
    webapps/upload/images
    but it doesn't work even when I am trying to store under webapps (root directory)
    Is there any way that I am not getting permission to write to the server??
    Any help is highly appreciated!!
    cheers

    the thing is that I am not getting any exception back to my browser> some of the values are inserted into the database (the ones that are not referring to any uploded items). i guess i have to do a print.stacktrace but I am not sure at which point...
    ok I am posting the full code to give you an idea. Your interest is much appreciated , thank you
    import java.sql.*;
    import java.text.ParsePosition;
    import java.text.SimpleDateFormat;
    import java.util.*;
    import java.util.Date;
    import gr.cretasport.util.*;
    import org.apache.commons.fileupload.*;
    import java.awt.Image;
    import java.io.*;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    * @author myron.veligradis
    * 17/09/2005
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class InsertArticle extends HttpServlet{
      * global variables
    String fieldName;
    Image imageIn;
    Resize rsImg = new Resize();
    Mirror mrImg = new Mirror();
    //ImageProcess ImPr = new ImageProcess();
    Date curDate;
    String datecur;
    String inputtext;
    BufferedWriter bw;
    String aRString ;
    String photoPath;
    File savedFile;
    String txtPath;
    String txtPathFullText;
    String author;
    String eidos;
    String kathgoriaID;
    String title;
    String rating;
    String kathgoria;
    String keimeno;
    String keimenoRest;
    String fullKeimeno;
    String hmeromhniaD;
    final String jspPrefix="<%@ page contentType=\"text/html; charset=iso-8859-7\" language=\"java\"  errorPage=\"\" %>";
    Connection con=null;
    Statement statement = null;
    ResultSet rs, rs1 = null;
    int kathgoriaIDInt;
    int ratingInt;
    public void init(ServletConfig conf) throws ServletException  {
      super.init(conf);
    public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException, UnsupportedEncodingException {
    //  try {
    //   req.setCharacterEncoding("iso-8859-7");
    //   catch (UnsupportedEncodingException uee)
      boolean isMultipart = FileUpload.isMultipartContent(req);
      HttpSession session = req.getSession();
      ServletContext sc = getServletContext();
       * GET THE FILE NAME
      curDate=new Date();
      datecur = curDate.toString ();
        String fileName = datecur.replaceAll("\\W","_");
        String strDate = curDate.toString();
        SimpleDateFormat formatter= new SimpleDateFormat ("EEE MMM dd hh:mm:ss zzz yyyy");
      Date date = formatter.parse(strDate,new ParsePosition(0));
      hmeromhniaD = new SimpleDateFormat("yyyy-MM-dd").format(date);
       *  GET THE PARAMETERS
       *  FILE UPLOAD *******************************************************
      System.out.println(isMultipart);
      DiskFileUpload upload = new DiskFileUpload();
      try {
       req.setCharacterEncoding("iso-8859-7");
       List items = upload.parseRequest(req);
       Iterator itr = items.iterator();
       while(itr.hasNext()) {
        FileItem item = (FileItem) itr.next();
    //    String articleTitle = new String(req.getParameter("articleTitle").getBytes("iso-8859-1"),"iso-8859-7");
       // check if the current item is a form field or an uploaded file
         if(item.isFormField()) {
         // get the name of the field
         // if it is name, we can set it in request to thank the user
         if (item.getFieldName().equals("author")) {
                author = new String(item.getString().getBytes("iso-8859-1"),"iso-8859-7");
         if (item.getFieldName().equals("eidos")) {
                eidos = new String( item.getString().getBytes("iso-8859-1"),"iso-8859-7");
         if (item.getFieldName().equals("keimeno")) {
                keimeno =item.getString();
                FileWriter fw1 = new FileWriter(getServletContext().getRealPath("webapps//upload"+"pro_"+fileName +".jsp"));
           fw1.write(jspPrefix+"<html><body>"+keimeno+"</body></html>");
           fw1.close();
           txtPath = ("upload/text/"+"pro_"+fileName+".jsp");
         if (item.getFieldName().equals("keimenorest")) {
                keimenoRest =item.getString();
                FileWriter fw2 = new FileWriter(getServletContext().getRealPath("//upload"+fileName+".jsp"));
           fw2.write(jspPrefix+"<html><body>"+keimeno+" "+keimenoRest+"</body></html>");
           fw2.close();
           txtPathFullText = ("upload/text/fulltext/"+fileName+".jsp");
         if (item.getFieldName().equals("title")) {
               // title = new String(item.getString().getBytes("iso-8859-1"),"iso-8859-7");
                System.out.println ("titlos "+title);
                title=getServletContext().getRealPath("webapps//upload");
         if (item.getFieldName().equals("rating")) {
                rating = item.getString();
         if (item.getFieldName().equals("kathgoriaID")) {
                kathgoriaID = item.getString();
       else {
        // the item must be an uploaded file save it to disk. Note that there
        // seems to be a bug in item.getName() as it returns the full path on
        // the client's machine for the uploaded file name, instead of the file
        // name only. To overcome that, I have used a workaround using
        // fullFile.getName().
        File fullFile  = new File(item.getName()); 
        //check if input file is actually an image
        if ( item.getName().toLowerCase().endsWith(".jpg") ||
        item.getName().toLowerCase().endsWith(".gif") ||
        item.getName().toLowerCase().endsWith(".bmp"))
         File temp = new File(getServletContext().getRealPath("webapps//upload")," temp.jpg");
         item.write(temp);
         //to class Resize pernei 2 inputs, to file kai to path string
         rsImg.resizeImage(temp,getServletContext().getRealPath("webapps//upload"+fileName+".jpg"));
         //to class Mirror pernei kai ayto 2 inputs, to file poy exei dhmiourgithei apo panw
         //pou to kanei overwrite epeidh pernoun to idio onoma me to time stamp
         Mirror.mirrorImage(new File(getServletContext().getRealPath("webapps"+fileName+".jpg")),
           getServletContext().getRealPath("webapps//upload"+fileName+".jpg"));
         System.out.println("upload/images/"+fileName+".jpg");
      kathgoriaIDInt= new Integer(kathgoriaID).intValue();
      ratingInt   = new Integer(rating).intValue();
       * HTML UPLOAD
      catch (Exception fe) {
      //get the string names to insert to database
      photoPath="upload/images/"+fileName+".jpg";
       * INSERT THE DATA INTO THE DATABASE
      InsertToDatabase();
      String url="/insertarticle.jsp";
      RequestDispatcher rd = sc.getRequestDispatcher(url);
      rd.forward(req,res);
    //res.sendRedirect( res.encodeRedirectURL( "indextest.jsp "));
    public void InsertToDatabase() {
      try {
       con=null;
       statement = con.createStatement();
       String insertprefix = "insert into articles(eidos,photopath,textpath,textpathfull,title,author,dateen,rating, kathgoriaID) VALUES"
         + "('" + eidos.trim() +"','" + photoPath.trim()  + "','"   +
         txtPath + "','" + txtPathFullText + "','" +title + "','"+ author + "','"+ hmeromhniaD + "','"+ ratingInt+ "','"
         +kathgoriaIDInt + "')";
       statement.execute(insertprefix);
       statement.close();
       con.close();
       catch (Exception e)
    }

Maybe you are looking for

  • Itunes wont open! please help me

    i logged into itunes about a week ago and it asked me to upgrade so i agreed after the installation i had to restart my computer so i did, from then on itunes just will not open sometimes i get an error message and sometimes not, i have tried everyth

  • I have an iPad 2 and want to upgrade to ios5 but have no pc what can I do?

    I have an iPad 2 and want to upgrade to ios5 but have no pc what can I do?

  • Smartform window borders not appearing in dot matrix printer Epson FX-1170

    Hi all. I have a smartform with boxes (made out of windows and its borders) and texts inside those boxes. In the print preview, it shows the window borders. However, when the actual printout comes, the window borders do not appear. I have tried to ch

  • Video tutorial AFCS SDK Navigator

    hello i just finished the second video tutorial and every thing seems to be working fine ( I added audio to the app since it has none). I am using the free developer edition but the room keeps crashing when my friend, from brazil,  and I conference w

  • Oracle temporary tables

    Hi , we have a application for transfering data approx 1 million records from one schema to another. the data is first inserted into a table temporarily and after all the data is transfered the data is manually deleted from this table. we are plannin