Location: PHPKode > scripts > Advanced file upload and ajax upload > advanced-file-upload-and-ajax-upload/DOC/index.html
<html xmlns="http://www.w3.org/1999/xhtml"><head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Stnc File Upload and Ajax  v4.0</title>
 <link href="shjs/css.css" rel="stylesheet" type="text/css">
 <link href="http://selmantunc.com/project/upload/tr/shjs/sh.css" rel="stylesheet" type="text/css">
 <script type="text/javascript" src="http://selmantunc.com/project/upload/tr/shjs/sh_main.min.js"></script>
<script type="text/javascript" src="http://selmantunc.com/project/upload/tr/shjs/sh_php.min.js"></script>
<script type="text/javascript" src="http://selmantunc.com/project/upload/tr/shjs/sh_html.min.js"></script>
<script language="javascript">window.onload = sh_highlightDocument;</script>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8868104-5");
} catch(err) {}</script>
<div id="wrap">
  <div align="center"><span class="style1"><a href="http://selmantunc.com/project/upload/">English User Guide</a></span> | | <strong class="style1"> </strong> | <strong class="style1"> </strong> | <strong class="style1"> </strong> | <strong class="style1"> </strong> <strong class="style1"> <a href="http://selmantunc.com/project/upload/tr">Turkish User Guide  </a></strong></div>
<div id="header">  
<h1>Stnc File Upload and Ajax  v4.0</h1>  
<h2>User Guide</h2>
<div id="left_bar">
  <h2><span id="result_box47"><span title="Tan&#305;t&#305;m">Presentation</span></span></h2>
      <li> <a href="#top">What does it do?</a> </li>
      <li> <a href="#ozellikleri">Features</a> </li>
      <li> <a href="#kullanimi">Use</a> </li>
      <li> <a href="#lisans">License information</a> </li>      
        <li> Basic operations </li>
          <li> <a href="#upload">UPLOAD</a> </li>
          <li> <a href="#extension_types ">extension_types </a> </li>
          <li> <a href="#language">language</a> </li>   

        <li> File operations </li>
          <li> <a href="#picture_uploads">picture uploads </a> </li>
          <li> <a href="#file_upload">file upload</a> </li>

		  <li> <a href="#result_report">result_report </a> </li>
          <li> <a href="#uploaded"> uploaded </a></li></ul>
        <li>Ajax Transactions</li>
		  <li> <a href="#ajax">Ajax Transactions</a> </li>
          <li><a href="#iletisim">Contact</a></li>

<div id="a_menu"> <div class="warning"><span id="result_box4"><span title="">Unnecessary   features are renewed and better resolved.</span></span></div>
   <h2 id="neiseyarar">What does it do?</span></h2>
    <p> <strong> - Allows you to upload files to your server, or files, object-based, flexible, can use it in all projects.
Ajax with jquery framework has the feature of upload to.
Also be available only ajax.
For more details, see the examples.  <a href="http://www.selmantunc.com/?file_id=100" target="_blank">Download  link</a> </p>

  <h2 id="ozellikleri">Features</h2>
      <li>      You can specify you want to download the file extensions and mime types of controls have been added.<br>
      <li> A single file or multiple files to upload offers.        <br>
      <li> Unique naming method is found.        <br>
      <li> Image files, will check whether the actual image file.        <br>
      <li> Prefix and suffix of the files to the front and rear is equipped with.        <br>
      <li> To calculate the size of uploading files do not have to deal with, the size and bytes, kilobytes, megabytes, just as stated.        <br>
      <li> Jquery Ajax file upload feature is due.        <br>
      <li> You can request to have only a single file named
        (For example, your company would be to install pdf information and the name of the newsletter each week would be advantageous in such cases.)       <br>
      <li> upload files with information you can get results. </li>
<h2 id="kullanimi"><span title="Kullan&#305;m&#305;">Use</span></h2>
    <p>You first need to create an installation form. Installation forms part of the action, which the information in this form will be sent to the file must be specified.</p>
<pre class="sh_html">
&lt;script src=&quot;ajax/upload.js&quot; type=&quot;text/javascript&quot;&gt; &lt;/script&gt;
<br>&lt;div id=&quot;result&quot;&gt;&lt;/div&gt;
<br>&lt;form method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;
id=&quot;file_upload_form&quot; name=&quot;aktar&quot; action=&quot;ajax/picture_add.php&quot;&gt;
<br>&lt;table width=&quot;500&quot; height=&quot;29&quot; border=&quot;0&quot;&gt;
<br>&lt;th colspan=&quot;2&quot; scope=&quot;col&quot; &gt; picture add&lt;/th&gt;
<br> $max_no_img = 4; 
<br> for ($res = 1; $res &lt;= $max_no_img; $res++) {     
<br> ?&gt;
<br> &lt;tr &gt;
<br>&lt;td width=&quot;100&quot;&gt;
<br> picture &lt;?php echo $res;?&gt;
<br>&lt;td width=&quot;500&quot;&gt;		
<br>&lt;input type=&quot;file&quot; id=&quot;picture_&lt;?php echo $res;?&gt;&quot; size=&quot;%50&quot; name=&quot;file[]&quot;  /&gt;	 
<br> &lt;/td&gt;
<br>&lt;?php } ?&gt;
<br> &lt;/tr&gt;
<br> &lt;/table&gt;
<br>&lt;input class=&quot;submit&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;save&quot; &gt;
<br>&lt;iframe id=&quot;upload_target&quot; name=&quot;upload_target&quot; src=&quot;&quot; style=&quot;display:none;&quot;&gt;&lt;/iframe&gt;


    <div class="img"></div>
    <p>To recall the necessary code</p>

<pre class="sh_php"><code>
require_once ('../class/stnc_upload-ajax_class_v4.php');
<br>$extension_types = array('jpg', 'gif', 'zip','png');
<br>$Uploader = &amp; new stnc_file_upload();
<br>$Uploader-&gt;language = '../class/stnc_upload_class_lang/english.php';
<br>$Uploader-&gt;picture_uploads (true, 'MB', '1');
<br>$Uploader-&gt;file_upload( 'MB', '3');
<br>$Uploader-&gt;  name_format (true,'reports','','');
<br>$Uploader-&gt;uploader_set($_FILES['file'], '../uploads', $extension_types,true);
<br>//echo $Uploader-&gt;uploaded_files[0];

<div class="img"> 
      <a href="http://selmantunc.com?ref=doc" title="selman tunc">www.selmantunc.com</a>
  <h2><span id="result_box22"><span title="Fonksiyonlar">Functions</span></span></h2>
    <div id="fonksiyonlar">
    <p>Functions, related to the installation process allows you to make various adjustments to the. Each function has a separate task.Allowed to use the functions described below.Example of the use of a variety of functions can be seen in the examples folder.</p>
 <!-- -->
      <h3 id="upload"> UPLOAD </h3>
      <p>Function is the founder and coach.</p>
<pre class="sh_php"><code>$Uploader = &amp; new stnc_file_upload();
$Uploader-&gt;uploader_set($_FILES['file'], '../uploads', $extension_types,true);</code></pre>
      <p> <code>$_FILES['file']</code>expression, our file upload files with form elements are indicated.</p>
      <p><code>'./upload_files' </code>expression indicates that the files will be installed where.</p>
      <p><code>$mime_types</code> statement which indicates that extensions will be installed.</p>
      <p><span id="result_box"><span title="true ifadesi en az bir adet dahi yükleme   yapacaksan&#305;z bunu belirtmenizi sa&#287;lar,e&#287;er yükleme mecburi de&#287;ilse false   de&#287;eri almal&#305;d&#305;r." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'"> <code>true</code> expression of at   least one even lets you specify that you want to do the installation, if   installation is not mandatory should be false.</span></span></p>
      <h3 id="extension_types"> extension_types</h3>
      <p>Specifies the type of file to be loaded.</p>
<pre class="sh_php"><code>$extension_types = array('jpg', 'gif', 'zip','png');</code> </pre>

 <!-- -->
    <!-- -->
      <h3 id="language"> language  </h3>
      <p>Will use the language and the language allows you to specify the location of the file</p>
      <pre class="sh_php"><code>$Uploader-&gt;language = '../class/stnc_upload_class_lang/english.php';</code>    </pre>
        <!-- -->
      <h3 id="picture_uploads"> picture_uploads </h3>
      <p>This section is intended only to customize the image upload feature<br>
        - The value of the real image files to check whether or içindir.True Gives false information.
        - The second value custom images, pictures, many of which will be reported as type size allows.
        Can take values "B", "KB", "MB"
      - Third, the size is the value for</p>
<pre class="sh_php"><code>$Uploader-&gt;picture_uploads (true, 'MB', '1');</code>   </pre>
 <!-- -->   
      <h3 id="file_upload">file_upload</h3>
      <p>Except that the only picture files (exe, pdf, zip) to upload their values are going to allow you to declare object.
        - The value of the file allows you to tell what size it would be in the form.
        Can take values "B", "KB", "MB"

      - The second value allows you to tell the size of the file</p>
      <pre class="sh_php"><code>$Uploader-&gt;file_upload( 'MB', '3');</code></pre>
      <h3 id="file_upload">name_format </h3>
      <p>Upload your files to adjust the settings are for naming, but also can request to have only a single file named.
        (For example, your company information each week to install pdf and name do you want the newsletter to be advantageous in such cases.)<br />
        <br />
          <em><code>'true'</code>=<span id="result_box2"><span title="">Have a   name remain constant in</span></span><br />
      </em> <em><code>'bulten'</code></em>=<span id="result_box3"><span title="">How hard is the name   of the file you want? </span><span title="">optional</span></span><br>
        'stnc_'=is expressed as a prefix to be given.
      '_stnc'=is expressed as a suffix to be given            
<pre class="sh_php">$Uploader->  name_format (true,'reportFile','st_','_nc');
 <!-- -->

<div class="warning">
  My English is not very good for the faults may be sorry
Create a unique name for naming method is used<br>
  To upload pictures and other files are a different size to be defined.<br>
 If you load image files, regardless of whether the lack of real images is checked.</p>

 <!-- -->
       <!-- -->
       <h2>Report Info</h2>
        <!-- -->
<h3 id="result_report">result_report </h3>
      <p>All errors in the installation process, and information which you can see this function. 
<pre class="sh_php"><code>$Uploader -&gt; result_report();</code></pre>
<h3 id="uploaded">uploaded</h3>
<p>If the operation was successful will be informed.True or false gives information</p>
<pre class="sh_php"><code></code>$Uploader-&gt;uploaded;</code></pre>
   <!-- --><h2>Ajax Transactions</h2>
      <h3 id="ajax">Ajax Transactions</h3>
      <p>Ajax examples for more detailed information about transactions, see, think of all the requirements are for Ajax.jquery is used
      <h2 id="lisans"><span id="result_box21"><span title="Lisans Bilgisi">License Information</span></span></h2>
<p> GNU GPL (General Public License) </p>
<p> This program is free software; you can redistribute it and/or             
   modify it under the terms of the GNU General var License              	  
   as published by the Free Software Foundation; either version 2          
   of the License, or (at your option) any later version.                    
  This program is distributed in the hope that it will be useful,           
  but WITHOUT ANY WARRANTY; without even the implied warranty of            
 GNU General var License for more details.        
      <h3 id="iletisim">Contact</h3>
      <p><a href="http://www.selmantunc.com/?file_id=100" target="_blank">Download Link </a></p>
      <p>Web site :<a href="http://www.selmantunc.com?ref=doc" target="_blank">www.selmantunc.com</a>
      <p>Mail :<a href="mailto:hide@address.com">hide@address.com</a>
      <p>Twitter:<a href="http://twitter.com/stunc" target="_blank">http://twitter.com/stunc      
      <p>Friendfeed :<a href="http://friendfeed.com/stnc" target="_blank">http://friendfeed.com/stnc </a>      
        <a href="http://www.facebook.com/s.stnc" target="_blank">http://www.facebook.com/s.stnc</a>
      <p>      </div>  
    <!-- end-->

</div><!--wrap son -->
Return current item: Advanced file upload and ajax upload