Is it possible to auto upload image to mysql via php?
Moderator: General Moderators
Is it possible to auto upload image to mysql via php?
I need to upload an image using php and store the image as blob in mysql. I understand the standard way is to create a form for the user, let the user choose the image to upload, click submit.
But can I create a php, for example, uploadImage.php?image="c:\myPhoto.jpg"
and when I type http:\\www.myhome.com\uploadImage.php?image="c:\myPhoto.jpg"
from my pc, I can automatically upload myPhoto.jpg to the myhome.com server?
Thank you for your kind help.
But can I create a php, for example, uploadImage.php?image="c:\myPhoto.jpg"
and when I type http:\\www.myhome.com\uploadImage.php?image="c:\myPhoto.jpg"
from my pc, I can automatically upload myPhoto.jpg to the myhome.com server?
Thank you for your kind help.
-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
Re: Is it possible to auto upload image to mysql via php?
where is the image coming from? how will the script know which image?
Re: Is it possible to auto upload image to mysql via php?
The image will come from the user. For example, the user has an image c:\myPhoto.jpg
So he will open his webbrowser, type http:\\www.myhome.com\uploadImage.php?image="c:\myPhoto.jpg"
to upload his image to the server myhome.com
So he will open his webbrowser, type http:\\www.myhome.com\uploadImage.php?image="c:\myPhoto.jpg"
to upload his image to the server myhome.com
-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
Re: Is it possible to auto upload image to mysql via php?
What rationale do you have for user having to type all of that when 2 or 3 clicks of a form accomplishes the same thing?
Re: Is it possible to auto upload image to mysql via php?
This is for a project, where the user is supposed to upload the image through this way. Of course the user does not manually type the address to upload, there will be a script doing this. Is there a way to do this? I tried using this way
but it doesn't work, seems like it tries to look for the file in the server, instead of the client PC.
Code: Select all
$image = $_GET['image'];
$handle = fopen($image, "rb");
-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
Re: Is it possible to auto upload image to mysql via php?
who/what executes the script that is to be used to upload the file? where will that script reside?
Re: Is it possible to auto upload image to mysql via php?
The user will execute the script to upload the file in his PC, so the script will reside in the user PC.
-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
Re: Is it possible to auto upload image to mysql via php?
So the user has apache and php installed on his computer?
Re: Is it possible to auto upload image to mysql via php?
er... actually I am not sure about this part, this will be done by my teammate, my task is to provide him the this php api
http:\\www.myhome.com\uploadImage.php?image="c:\myPhoto.jpg"
http:\\www.myhome.com\uploadImage.php?image="c:\myPhoto.jpg"