Showing uploaded image after successful upload

后端 未结 2 1504
小蘑菇
小蘑菇 2021-01-16 21:10

I am using the Carrierwave gem inside of Magnific Popup (lightbox). What I want to do is that after uploading a image that it will show the newly uploaded i

2条回答
  •  难免孤独
    2021-01-16 21:57

    you are doing this very complicatedly..

    this is the simple solution.Write javascript function to send the selected image using ajax.

    
    

    ++++++++++++++++++++++++++++++++++++++++++++++++++++

    In Html file write the below code to upload the file..

                 

    ++++++++++++++++++++++++++++++++++++++++++++++++++

    in php file use the below code small_img.php

    $path = "/var/www/upload/profile_pic/";
    
    if(move_uploaded_file($tmp, $path.$actual_image_name))
    {
    echo " ";
    }
    

    this works for me...try it.. make some changes according to your code

提交回复
热议问题