Laravel Gallery App - 6 - Uploading images to gallery using Dropzone JS

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 57

  • @shahmirjadoon1322
    @shahmirjadoon1322 7 лет назад

    Hi Amitav Roy,
    Your teaching style is really awesome. I just need to ask that you created model Images but you haven't created its migration then how images table come to your Database ?

    • @workfromhomedev
      @workfromhomedev 7 лет назад

      you can do it manually in php my admin

    • @amitavroydev
      @amitavroydev  Год назад

      Hope this is solved.
      Thanks for the comment and I am glad you like the content

  • @freshlybakedkamote8047
    @freshlybakedkamote8047 9 лет назад

    Great Tutorial. But I'm just curious will this post a security issue? I mean do we need to do an upload image exploit validation? There is a possibility the user may upload an image that can exploit your application. How are we going to implement this on laravel? Since you are using dropzone here? how do we handle such issues?

    • @amitavroydev
      @amitavroydev  9 лет назад

      +Madzmar Ullang The only way to validate that would be to do a validation of the mime type after the file is uploading. I need to check if that can be done first at the client end.

  • @hvdpro
    @hvdpro 9 лет назад

    Nice tutorial. Can wait for the next part.

    • @amitavroydev
      @amitavroydev  9 лет назад +1

      Horia Dobre Great... will be uploading the next part on Wednesday... stay tuned.
      Cheers

  • @Shitatov
    @Shitatov 8 лет назад

    I am having problems with the image upload, my console error is "post localhost:8000/image/do-upload 404 (not found)
    Any reasons as to why?

    • @amitavroydev
      @amitavroydev  8 лет назад

      +Aaron Sherry need to see the code. 404 means ideally you have made some mistake with the url hence a not found error.

  • @andixhafa6031
    @andixhafa6031 8 лет назад

    Hi,
    I am trying to use dropzone on my laravel site but have some problem.
    1- There is no file on my backend. I tryed "dd ($request->file('media'));" and it show null. When I remove the dropzone class in form tag it work. Any idea?
    2- I have added a submit button and method="post" on form tag because it doen't submit auto
    Thank you

  • @vishalsrivastava9263
    @vishalsrivastava9263 5 лет назад

    Is there any process to remove image ?? because it is automatically loading after selecting.

  • @alshanmahroof9686
    @alshanmahroof9686 8 лет назад +2

    i am getting 500 internal error. Please Help me

  • @sandeepkumar-ys3li
    @sandeepkumar-ys3li 8 лет назад

    how to resize image ............i have the code but it have to make the two image first is original image and another is resize size ...........how can solved it ............

    • @amitavroydev
      @amitavroydev  8 лет назад

      check the video where i am using intervention... that is how you can create the images

  • @fhoulbr
    @fhoulbr 8 лет назад

    Hi, I got an issue following your tutorial as you have a mysterious navbar appearing after you add the auth validation on the gallery. Do you have the HTML code of it somewhere ? I'm able to create it myself, there's no doubt, but as I'm trying to follow your tutorial, this is missing somewhere :)

    • @amitavroydev
      @amitavroydev  8 лет назад

      Hahaha.. good catch. As far as I remember the first screen that you see is where I didn't have the session logged in and then I worked on the code and when tried to save gallery, I got error.. understood I haven't logged in and so did that and then continued the tutorial. So, the magic of editing confused you :)

    • @fhoulbr
      @fhoulbr 8 лет назад

      Not exactly. I ment you have designed a toolbar to disconnect which show the current logged in user. As well as the title of the page and the Home link... But neither of those are shown on your tutorial yet. I know I can reproduce it even if I don't use Foundation and prefer other CSS frameworks. Have you put this project with this bar on GitHub?

  • @afghanboy4022
    @afghanboy4022 8 лет назад

    hi master !
    could you please tell me if i store images in storage folder how to access that images ?
    i mad an app so the images are in storage folder and not gets display.
    thank you !
    i hope to get some tips.

    • @amitavroydev
      @amitavroydev  8 лет назад

      Well you should not store images in storage folder. That folder is for laravel to use. The cache data, log files etc are stored there. The only folder where you should store images and any other files which are publicly available is the public folder.

    • @ALEXEIS
      @ALEXEIS 6 лет назад

      php artisan storage:link

  • @ashishrprastogi
    @ashishrprastogi 9 лет назад

    Nice tutorial, I am still waiting for next part.... i did add 2 file .css and .js to master.blade.php as you showing in this tutorial but dropzone is not working.. after refresh page I got just a white box (as you video) and it's not clickable even " Drop files here to upload'' text is missing.... any other file need to add????

    • @amitavroydev
      @amitavroydev  9 лет назад

      Ashish Rastogi No, the two files are what you need to get that thing.

    • @ashishrprastogi
      @ashishrprastogi 9 лет назад

      Amitav Roy got it okay!

    • @ashishrprastogi
      @ashishrprastogi 9 лет назад

      Amitav Roy how many images can be uploaded in one time ? what is the limit and can we managed limit ...actually I want to upload 4 images in one time...

  • @jerearaujo03
    @jerearaujo03 9 лет назад

    Where is the code to make this nav bar? Thanks!

    • @amitavroydev
      @amitavroydev  9 лет назад

      That's a dynamic nav which you can find inside nav Controller and for the active link, the logic is inside the route change which you can find in app.js

  • @santiagonicolasgranada8156
    @santiagonicolasgranada8156 9 лет назад

    Nice Tutorial, but it seems like it's not saving in my database. I only get internal server error in my network! Hope you can help. You just earned a subscriber mate.

    • @amitavroydev
      @amitavroydev  9 лет назад

      +Santiago Nicolas Granada send me some details and I will help you out. no issues with that

    • @santiagonicolasgranada8156
      @santiagonicolasgranada8156 9 лет назад

      +Amitav Roy I just fixed it . I felt stupid. I had the $filename variable as $galleryname. but anyway thank you for taking your time to respond. I've been following your channel.

    • @amitavroydev
      @amitavroydev  9 лет назад

      +Santiago Nicolas Granada NO issues my friend.. a lot of time we do get stuck with such stupid issues... :) Good to know you fixed that.

  • @fikri.abdoul
    @fikri.abdoul 8 лет назад

    any full source code hosted somewhere?

  • @EduardoHernandez-tb9cz
    @EduardoHernandez-tb9cz 6 лет назад

    does this work for any type of file? :)

    • @amitavroydev
      @amitavroydev  6 лет назад +1

      Yes, it's an uploading library. You can allow the user to upload any kind of files like PDF, Word documents or any other.

  • @medoune89
    @medoune89 8 лет назад

    Hello, sir i have a problem to upload with dropzone...
    The mistake is method image() is not an instance

    • @amitavroydev
      @amitavroydev  8 лет назад

      Can you share the code?

    • @medoune89
      @medoune89 8 лет назад

      My method doImageUpload is here :
      public function doImageUpload(Request $request)
      {
      // Get the file from the post request
      $file = $request->file('file');
      // Set my file name
      $filename = uniqid() . $file->getClientOriginalName();
      // move the file to correct location
      $file->move('gallery/images', $filename);
      // Save the details into the database
      $gallery = Gallery::find($request->input('gallery_id'));
      $image = $gallery->image()->create([
      'gallery_id' => $request->input('gallery_id'),
      'file_name' => $filename,
      'file_size' => $file->getClientSize(),
      'file_mime' => $file->getClientMimeType(),
      'file_path' => 'gallery/images/' . $filename,
      'created_by' => Auth::user()->id,
      ]);
      }
      }
      file gallery.php is here :

    • @amitavroydev
      @amitavroydev  8 лет назад

      I think your relations are creating a problem. Why don't you try doing one thing... first directly save the image $image->create instead of $gallery->image->create()

    • @medoune89
      @medoune89 8 лет назад

      Si i have repeated exactly your tutorial but i have the dame err
      or two months ago

  • @fsuuaas
    @fsuuaas 8 лет назад

    Please Make Tutorial For DropZone Multiple File Upload with a Submit Button.