Jump to content

Attachment on register process Prestashop 1.6


Dawn

Recommended Posts

Hi, i'm trying to put a attachment input when on the customer register. I put this code on authentication.tpl

 

<input type="file" name="fichero">

 

and the uploaded code on AuthController.php 

 

 

if(isset($_FILES['fichero']['name'])){
  move_uploaded_file($_FILES['fichero']['tmp_name'], 'path to /upload'.$_FILES['fichero']['name']);}
 
around the line 553
 
if (!$customer->add())
$this->errors[] = Tools::displayError('An error occurred while creating your account.');
else
{  //upload code here
 
but can't move file. Upload folder has permisions. What am doing wrong? 
Link to comment
Share on other sites

Did you checked folder permissions? Is it writable by php owner?

 

Try a simple test-case:

<?php
  $myfile = fopen("path to /upload/testfile.txt", "w") or die("Unable to open test file!");
  fwrite($myfile, "Test file access.");
  fclose($myfile);
?>
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...