Skip to content
Advertisement

Tag: file-upload

Renaming files with random string after upload and storing the name in array

I’m trying to process multiple files upload with foreach then rename the files with random string and store the file names in an array, here’s my current code: I can’t find where the problem is, should I use foreach for every generated file name then use move_uploaded_file inside the foreach? Answer You are completely wrong. You have initialized $_FILES[‘files’][‘name’] in

Upload image in Laravel

I try these code in controller: My Html input file: but i can’t upload. Any idea? Answer you can use storage::putFile(‘folder_name’, $request->image) this will return automatic generated filename and you can store that in your database. And make sure your have your default file system set to public and your form has this enctype=”multipart/form-data” Reference https://laravel.com/docs/5.5/filesystem#storing-files

Upload a ZIP file and UNZIP ftp folder via PHP

I want to make a form where you can fill FTP login server and get option to upload ZIP file. The script works apart from the last part (UNZIP the file) I want to perform UNZIP uploaded file. Does anyone know what is the problem? TIA THE ERROR Successfully uploaded ftp://:@ftp.***.com/htdocs/file.zip Warning: ZipArchive::extractTo(): Invalid or uninitialized Zip object in C:xampphtdocsupload.php

PrestaShop: allow customers to upload PDF, AI and EPS files as product customization

I am running Prestashop 1.6.1.7 and I have the following pictureUpload() method that allows users to upload files of their choosing. By default Prestashop allows uploads of GIF, JPG, JPEG or PNG only. I’m trying to allow users the ability to upload a few more types (pdf, ai and eps specifically) Here is the pictureUpload() method in the productController override:

Advertisement