title: Get the whole file path or upload file use bash shell cgi
body: <p>I want to get the file path of select file, but the file path can not be read according to the security of browser itself .<br>
  For example, firefox just read filename(ex test.txt).<br>
  Concerned about it, what can I do to read the file path of file button selected in bash shell scripting?<br>
  The reason I need the file path is that I want to upload the file to the server, so I want to use command cp to do it, like:</p>
  
  <p><code>cp filepath(and filename) serverpath</code></p>
  
  <p>Can I use simple button(type=button instead type=file) to do it with special method(with a type=text to do the trick)?<br>
  The original code I tried is:</p>
  
  <pre><code>#!/bin/sh
  
  #=================================================
  #   PATH defination
  # ================================================
  
  
  
  #=================================================
  #   Main
  # ================================================
  echo "Content-type: text/html"
  echo "Pragma: no-cache"
  echo ""
  echo "&lt;HTML&gt;&lt;HEAD&gt;"
  echo "&lt;meta http-equiv=content-type content=text/html; charset=UTF-8&gt;"
  echo "&lt;TITLE&gt;$msg010&lt;/TITLE&gt;"
  . ${WWW_SCRIPTS_LIB_PATH}/style-init.sh
  echo "&lt;/HEAD&gt;"
  echo "&lt;BODY&gt;"
  ShowSubLogo "$msg010"
  
  if [ "$CONTENT_LENGTH" != "" ]; then
      read data
      filesplit1=`echo $data | awk -F'&amp;' '{print $1}'`
  
  if [ "$filesplit1" != "fileis=" ]; then
      filename=`echo $filesplit1 | sed "s/%20/ /g" | cut -f 2 -d "="`
  fi
  
  fi
  
  echo "&lt;br&gt; &lt;/br&gt;"
  echo "&lt;br&gt; &lt;/br&gt;"
  echo "$msg050"
  echo "&lt;br&gt; &lt;/br&gt;"
  echo "&lt;form name=Updfw_form method=post action=EippsUpdate.cgi&gt;"
  echo "$msg020"
  echo "&lt;input name='fileis' id='UpLoad' type='file'&gt;"
  echo "&lt;br&gt; &lt;/br&gt;"
  echo "&lt;input name='update' value='$msg030' class=bton_over value=\"$com010\" type='submit' onmouseover=\"this.className='bton_out'\" onmouseout=\"this.className='bton_over'\"&gt;"
  echo "&lt;input name='cancel' value='$msg040' class=bton_over value=\"$com010\" type='reset' onmouseover=\"this.className='bton_out'\" onmouseout=\"this.className='bton_over'\"&gt;"
  echo "&lt;/form&gt;"
  echo "&lt;/BODY&gt;&lt;/HTML&gt;"
  </code></pre>
  
  <p>It just read the filename, and in crome browser, it can not work.</p>
  
  <p>Or is there another way to upload a file to server that user can select?
  I searched and seldom look the example of bash shell version.</p>
  
  <p>Just the whole filepath! Or upload file to browser!</p>
  
  <p>Any answer appreciate.</p>