Advertisement
xpeed

asdfasdf

Sep 2nd, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <form action="project.php" id="xsImportForm" class="form-horizontal" method="post" enctype="multipart/form-data">
  2. <p><strong>Import Save Project</strong></p>
  3. <div>
  4. <button class="btn btn-inverse btn-file btn-lg"><i class="fa fa-upload"></i> &nbsp;Browse Project File
  5. <input type="file" id="xsDgnInput" name="xsImportDesign" multiple />
  6. </button>
  7.  
  8. </div>
  9. <input id="xsImpStatus" type="hidden" name="status" value="xsImpFile"/>
  10. </form>
  11.  
  12.  
  13.  
  14.  
  15. //project
  16.  
  17. <?php
  18. if(isset($_POST['status']) && $_POST['status'] === "xsExpFile" && !empty($_POST['xsJSONFile'])) {
  19. header( 'Content-Description: File Transfer' );
  20. header( 'Content-Type: application/octet-stream' );
  21. header( 'Content-Disposition: attachment; filename=builder.xs' );
  22. header( 'Content-Transfer-Encoding: binary' );
  23. header( 'Connection: Keep-Alive' );
  24. header( 'Expires: 0' );
  25. header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
  26. header( 'Pragma: public' );
  27.  
  28. echo $_POST['xsJSONFile'];
  29.  
  30. }
  31. if((isset($_FILES['xsImportDesign'])) && $_POST['status'] === "xsImpFile"){
  32. $ImpFile = file_get_contents($_FILES['xsImportDesign']['tmp_name']);
  33.  
  34. exit(json_encode(array('data' => $ImpFile)));
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement