I have a form that contains a choose file field. I want to upload a pic into a particular folder. I am able to upload the file into database but couldn't see it in the specific folder where i am moving it into.
specify destination like
$destination = 'destination folder';
and after saving your records to database, to move the image into destination folder,
Input::file('image')->move($destination, $fileName)
where $filename is a name of image
Related
I save images in a controller with the $imagePath = "/upload/images/{$adver} address. Then these images are saved in a public folder in the root folder, but when I move these images file into the C-Panel I can't see them.
The address of an image is saved in advertise table and the images are saved in the public folder. I use src="advertise.image1" to show an image.
The images are in a database and I get the route to database to show them on the website.
Are you using the public_path helper function?
$imagePath = public_path("/upload/images/{$adver}");
You may have issues with your public path if you're saying they're not working on the remote location. Is your remote public path set as public_html rather than public?
I am using the latest CKEditor (4.9.2). I have integrated it successfully with a file browser (DevExpress) and everything works fine.
I use an initial upload path, common for both files and images. This directory has a quite large and complex structure (usually up to 6-7 levels). If the user wants to replace an existing image or file the file browser opens and he has to open six or seven folders in order to get to the folder that the new image is stored. Usually, the images the users replace are stored in the same folder with the one they are replacing. In my opinion, that should be the default behavior. If I select to see an existing image’s properties and then I hit the “Browse Server” button, to have the file browser to open in the folder the image resides.
Is there any way to pass the current image path, in the image url field, to the file manager? In that case with a little parsing I can set the file browser’s initial path to the same folder the existing image is stored.
Is that possible? I imagine that we must first get the image path from the image URL field and alter the “Browse Server” button’s code to pass it as a url parameter to the file browser.
This is a bit 'hackish', but inside your file manager, you can use this to get the existing value of URL field:
window.opener.CKEDITOR.document.$.getElementsByClassName('cke_dialog_image_url')[0].querySelector('input').value
cke_dialog_image_url is the CSS classname of the table that has the URL input field.
I have a problem about the file uploading in codeigniter, I can see the picture in the folder name "uploads", also I can see the picture name with extension in database but it cant see in page when I view source code it will say "page not found" and I don't know why.
here is my picture->
Try this-
thanks #jtheman
check your .htaccess code and replace with new code
or
check the image file or upload folder permission
or
check any other .htaccess files is found inside the upload folder
I have a blog post application where I am uploading files to be displayed along with the post itself. I can successfully upload the image but I am unable to display it .
Here is how I am uploading it to a folder within my application..
and here is how i am displaying it..
I am uploading the image to the uploads folder under my public folder. and I am storing the image in the database as follows..
Although I can see that the image path is correct. I did an echo of the path that is being generated and the path to the image is correct.
Can you please let me know if there is something that I am doing wrong.
thanks
Change
$file = $file->move(public_path() . '/images/uploads', $filename);
to
$file = $file->move('images/uploads', $filename);
the above code will upload the picture to the public_path/images/uploads.
In your code, i can see you have used full physical path of your image directory to display the picture. Physical path only needed when you are going to upload an image.
try the following:
<img class="img-responsive" src="/images/uploads/{{ $post->thumbnail }}" >
You are storing the thumbnail within the post model, but are trying to fetch it form the blog model. Try $blog->post->thumbnail instead. (If you have set a relationship)
I have made an image upload page. this all works smooth.
My problem is when i upload an image called filename.jpg and i upload it again the same image uploads but changes the name to filename1.jpg
how can i force this and make a message with something like 'the image you upload was allready uploaded'
thanks
the change in filename was initiated by the os of server computer
to produce the promt you have to check the file name for duplicates while you are uploading
using the php script
if you have a database which stores the filenames then it is very easy