upload

PHP directory error - open_basedir restriction in effect

本秂侑毒 提交于 2021-01-23 11:06:34
问题 I've got some PHP code that'll create a new file in a set directory: $target_path = "reports/" . basename($Report_Filename) . ".php"; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { /* code here */ } It was working perfectly, and has done for some years now, unfortunately we've just moved across to a new server, and I'm now getting this error: [15-Jul-2010 16:15:48] PHP Warning: Unknown: open_basedir restriction in effect. File(C:\Windows\TEMP\) is not within the

Uploading picture in Laravel Registration

不想你离开。 提交于 2021-01-22 17:03:43
问题 I'm making a website where users can upload their own profile picture, with their credentials such as name, email, password, and dob using Laravel Authentication. After doing php artisan make:auth , there's this function in AuthController.php : protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'dob' => $data['dob'], 'profile_picture' => $data['profile_picture], ]); } and here's my form:

Uploading picture in Laravel Registration

你。 提交于 2021-01-22 16:49:12
问题 I'm making a website where users can upload their own profile picture, with their credentials such as name, email, password, and dob using Laravel Authentication. After doing php artisan make:auth , there's this function in AuthController.php : protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'dob' => $data['dob'], 'profile_picture' => $data['profile_picture], ]); } and here's my form:

Stream upload 'POST' in Spring WebClient

亡梦爱人 提交于 2021-01-04 03:24:31
问题 I am uploading streams of (raw bytes) data using HTTP posts using WebClient: final byte[] rawData = IOUtils.toByteArray(sourceInputStream); webClient.post() .uri(uri) .contentType(MediaType.APPLICATION_OCTET_STREAM) .bodyValue(rawData) .exchange()... I am concerned there is a potentially a lot of memory used given sometimes these objects can be quite big (~200Mb) so would like to read directly from the InputStream and upload as a stream. I tried: bodyValue(BodyInserters.fromResource(new

How to increase the performance of a file upload using native sftp functions and fwrite in PHP

痞子三分冷 提交于 2020-11-29 03:48:29
问题 Hi I am using the following code to upload a huge file (500MB) to a sftp server. <?php $connection = ssh2_connect($this->host, $this->port, null); $sftp = ssh2_sftp($connection); $connection_string = ((int) $sftp) . $remotePath . $remoteFilename; $stream = fopen('ssh2.sftp://' . $connection_string, 'w'); $source = fopen($localFilepath, 'r'); if (!$stream) { throw new Exception('Could not create file: ' . $connection_string); } while (!feof($source)) { // Chunk size 32 MB if (fwrite($stream,