title: File Upload Access with Django
body: <p>I'm trying to take a user uploaded file and run it through another process and get the output.</p>
  
  <p>This is what I currently have:</p>
  
  <pre><code>from subprocess import check_output
  
  def index(request):
      if request.method == 'POST':
          try:
              output = check_output(['/home/username/app', request.FILES['file']])
              return HttpResponse(output)
          except:
              return HttpResponse('&lt;a href="/"&gt;Home&lt;/a&gt;')
      return render_to_response('index.html', context_instance = RequestContext(request))
  </code></pre>
  
  <p>So if I wanted to pass the file as a command line argument into /home/username/app, how would I go about doing that?</p>