Laravel 3.2.13 Upload File - php

I'm trying to upload files not from Form but from directory, say the given directory is "D:\Pictures".
$directory = "D:\Pictures";
How to retrieve the files stored in that folder and then upload to my web application?
I'm using old laravel here, version : 3.2.13.

The answer is you CAN'T. Upload the file not from Form but from directory is an dangerous action. Simply imaging that hackers could create a simple website for submit something and easy to stolen your file easily.
So, reconsider about your goal. Why you have to upload a file from client computer without select from form?

Related

PHP file stream and viruses

I'm designing a website for my university's engineering related program. I've just added file uploads for registered users to host projects files they are working on. These uploads are done using a html form. The form and file data is passed to the server using Ajax which then uploads the file to Amazon web services s3. The file is not stored locally. Links are then provided on the user's page. The user base is small for know but I'm worried with more users there will be a risk of virus uploads. Could infected files uploaded with this method be executed on the server? Also is there an alternate way of accomplishing this or preventing virus uploads?

Adding image upload to html page (mysql backend)

Relatively new to web development here, but am trying to implement an image upload feature, the contents of which will be previewed to the person (administrator) uploading the image, and then stored in a database (and displayed to the end user on a different page).
I found a resource that uses a Imageshack API, and was a bit confused about what this is and how the person implemented the API to achieve the image upload. The code for this is here: http://www.sceditor.com/posts/how-to-upload-and-insert-an-image/
When I googled "Imageshack API," I kept running across something that said I need to request a key. What does this mean, and do I have to do it? Is this the easiest way to go about creating an image upload feature for my purposes?
Thank you all very much!
Imageshack API is for uploading image files to your account hosted at Imageshack.com. It seems that you want to upload image files to your own website and store such files on your own web servers (either in a cloud service such as AWS or your co-located/managed servers at some data centres). So, you probably do not want to use Imageshack.
As to how to upload image files using HTML & PHP, you may want to check out a short tutorial at:
www.w3schools.com/php/php_file_upload.asp
Also, by the way, storing image files into a database such as MySQL may not be a good idea -- image files should be stored as files. It is faster to access such image files on a web server than to access image contents stored in a database.

Symfony2 upload file without form

Using symfony2, I would like to upload some files only from their path on my PC.
I read an excel file containing some path to pictures (like /home/thibault/pictures/*.jpg) and I want to upload them on my server. So, I do not want a form.
All the documentation I have read deal with upload from a form, is this possible to do that without ?
Thanks in advance,
No it is not possible. For what you are looking for you need to deploy some locally running agent. Any browser will not permit you to pull files form folders on the user's computer. The user has to be the one to say what files they want to upload if it is to be done inside a browser.

How to upload multiple images to a server into a Django application?

I'm currently working on a Django application using AngularJS for the frontend part.
I want for the moment to upload some images on the server and get as callback a list with the paths of the uploaded files. I want to send afterwards to the API (I am using Tastypie framework) as a POST request the callback and insert it into the database in a specific field. My issue is that I don't know how to approach the images upload (I should use PHP?) part and most important how to receive the callback? I hope that I explain clear enough. :D
Documentation for uploading files in django: https://docs.djangoproject.com/en/dev/topics/http/file-uploads/
HTML only allows to upload one file per upload-controller. To upload multiple files either the user can create a zip file (or similar), upload that and on the server side you extract it into multiple files. Or you have to use a flash component. There are lots of these available, for example http://developer.yahoo.com/yui/uploader/

Upload an image using a URL in Codeigniter

I went through the tutorial to upload an image in Codeigniter with the Upload library, but I was wondering: Is it possible to upload an image using a URL in Codeigniter?
Yes, it's possible. See the answer on this question: Saving image from PHP URL.
If you're going to go the cURL route, see the CodeIgniter wiki entry: http://codeigniter.com/wiki/Curl_library/
If I understand your question clearly;
I think Upload a file using URL isn't a properties of Codeigniter or any other technologies. It's about operating system.
For example, you have a upload system with generated by PHP and Codeigniter. When you click Browse button, you can select an image in your computer or you can write an image link hosted on the internet. When you insert an image link, operating system generate a temporary path source (with your image) in your computer. In Windows, this could be C:/Temp folder. Then you can upload your image which you insert its' link.
File Uploading Class
Note: My english is off. Sorry for that.

Categories