Category : upload

I’m triying to upload an image via php and insert the path in SQL. But I don’t know what I’m doing wrong. It is redirect but it won’t upload or insert. Any ideas? This is HTML <form action="postgame.inc.php" method="POST" enctype="multipart/form-data"> <h1>Post a game</h1> <input type="text" id="ngame" name="ngame" placeholder="Game Name" /> <input type="text" id="dgame" name="dgame" placeholder="Game ..

Read more

after long hours snipping code and placing in respective places in my own multi file uploader code ive run into an error wihout any reason to my knowledge the code bellow is what im using <?php ini_set("error_reporting", 1); if(isset($_POST[‘btnSubmit’])) { for ($i = 0; $i < count($_FILES[‘files’][‘name’]); $i++) { if ($_FILES["files"]["size"][$i] < 1000000000) // Check ..

Read more

Laravel Version: 8.35.1 PHP Version: 8.0.0 Description: I’m uploading an image with laravel using this code: $product_image = $request->file(‘product_image’); $product_image_extension = $product_image->extension(); $product_image_name = time() . ‘.’ . $product_image_extension; $product_image->storeAs(‘/media/product_images’, $product_image_name); $model->product_image = $product_image_name; It works fine, the file is uploaded to storage/app/media/product_images/. Then, I run the command php artisan storage: link to create the ..

Read more

I’m working on the PHP script where I want to add image watermark PHP while uploading an image in PHP? I have code which is not working only uploaded the images without watermark? Here my code $data = explode(".", $_FILES["upload_file"]["name"]); $extension = $data[1]; $new_file_name = rand() . ‘.’ . $extension; $path = $_POST["hidden_folder_name"] . ‘/’ ..

Read more