Category : upload

When uploading images I realize FIRST I can use store method which saves images in the storage/app/public by default then I’ll have to create a symbolic link from public/storage to storage/app/public to access the image. SECOND, I can still use move method and have the image saved in the public/images directly. I feel like the ..

Read more

I have this function in my controller that create post and try to upload images and video : public function view_add_posts(Request $request) { $data=$request->all(); $rules=[ ‘video’ =>’mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:50424405 |required’]; $validator = Validator($data,$rules); if($validator ){ $arr[‘categories’]=Category::all(); if ($request->ismethod(‘post’)){ $x=0; foreach($request->file(‘filenames’) as $file) { $x++; } $id= get_id(‘posts’); $post = new POST(); if($request->hasfile(‘video’)){ $post->video=’yes’; } $post->id=$id; $post->category_id=$request->category_id; $post->title_ku=$request->title_ku; ..

Read more

posting this again because I didn’t find to solution yet. Laravel can’t found the file storage/app/public/upload when I usehttp://127.0.0.1:8000/storage/upload/The_fileName.x I get 404 not found I’ve tried http://127.0.0.1:8000/storage/app/public/upload/The_fileName.x too. what should I do ? In DocumentController : public function store(Request $request) { $request->validate([ ‘doc’ => "required",… ]); $document = new document(); $file = $request->file(‘doc’); $filename=time().’.’.$file->getClientOriginalExtension() ; ..

Read more

How to save my response to storage? $headers = array( "Content-type" => "text/html", "Content-Disposition" => "attachment;Filename=Contract.docx" ); $content = View::make(‘contracts.test’); $file = Response::make($content,200, $headers); Storage::disk(‘google’)->put($path, $file); Next is working for received file from form but not for code above Storage::disk(‘google’)->put($path, $request->file); Thanks Sourc..

Read more

$data = Student::find($id); $filePath = $data[‘photo’]; unlink($filePath); $filepath hold a value like this – storage/other-document/images-1/jj.png ,because am storing the file jj.png inside the folder images-1. images-1 is a custom created folder. The unlink function here deletes the file from this images-1folder . but i want the images-1 folder also to get deleted along with this. ..

Read more

I have a large input file for 200MB-1GB, which will be uploaded in digital ocean, I want the process percentage to appear, for that I have to get the percentage, is there a way? here is my code to upload to digital ocean $name = Str::uuid(); $extension = $request->file(‘url’)->extension(); $fullname=$name.’.’.$extension; $disk = Storage::disk(‘digitalocean’); $disk->put($fullname, fopen(request()->file(‘url’), ..

Read more

I am developing a project with Laravel. My directory structure on cPanel is as shown below. – company-app (folder) – company-files (folder) – public_html — company.domain.com (subdomain) I moved all Laravel files except public folder to "company-app" folder. I wanted to exclude it from the document root for security purposes. Apart from these, there are ..

Read more

Hi I’m using unisharp laravel-filemanager for user to upload their products photos when the image uploaded this address will save in database /photos/44/606074649c651.jpg and I can use it by {{asset(‘storage/’.$product->cover_img)}} and Thumbnail saved in this address /photos/44/thumbs/606074649c651.jpg How can I get the address of thumbnail and how can I use it in blade? Sourc..

Read more