Well, using the snippet I found on Google to upload the downloaded user image and put it in your directory in the Content section
But Im worried about duplicates, so I was going to load the image as a random number
Well here is my code, which you probably understand what it is going to do through it anyway
<label for="file">Profile Pic:</label> <input type="file" name="ProfilePic" id="ProfilePic" /><br /> <input type="submit" name="submit" value="Submit" /> $ProfilePicName = $_FILES["ProfilePic"]["name"]; $ProfilePicType = $_FILES["ProfilePic"]["type"]; $ProfilePicSize = $_FILES["ProfilePic"]["size"]; $ProfilePicTemp = $_FILES["ProfilePic"]["tmp_name"]; $ProfilePicError = $_FILES["ProfilePic"]["error"]; $RandomAccountNumber = mt_rand(1, 99999); echo $RandomAccountNumber; move_uploaded_file($ProfilePicTemp, "Content/".$RandomAccountNumber.$ProfilePicType);
And then, basically, after that Im Im trying to get him to put this random number in my database
Someone gave me a new snippet that looks like it will do what I want, but now the file does not reach my directory
$RandomAccountNumber = uniqid(); echo $RandomAccountNumber; move_uploaded_file($ProfilePicName,"Content/".$RandomAccountNumber);
source share