| View previous topic :: View next topic |
| Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Aug 15, 2006 6:57 pm Post subject: HTTP Upload |
|
|
Is there a way that I can upload to a site with VDS via HTTP? I don't want to have to setup FTP for every user just to upload a file/image. The dir on the site will be set to CHMOD 777.
thanks _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Wed Aug 16, 2006 3:12 am Post subject: |
|
|
You'll need to setup a php/cgi script on the server end which can accept POST's, use VDSIPP and POST data to the form, post a file as well.
Setting CHMOD to 777 is a security risk if you are on a shared server, as most users on the system now have access to read the file. This is fine if it is not a file that contains passwords, etc. |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Aug 16, 2006 8:58 pm Post subject: |
|
|
You don't by chance have an example CGI or PHP script that I could use? I am not good at CGI/PHP.
Thanks _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Wed Aug 16, 2006 10:43 pm Post subject: |
|
|
| I don't have one, but check http://php.resourceindex.com, there are several php scripts available. |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Aug 16, 2006 10:57 pm Post subject: |
|
|
Thanks, I'll take a look. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Aug 17, 2006 11:05 pm Post subject: |
|
|
Check out this PHP script for uploading to a server. You will need to create
a directory named "files" and chmod it to 777.
Hope this helps...
| Code: | <form name="form1" method="post" action="" enctype="multipart/form-data">
<input type="file" name="imagefile">
<br>
<input type="submit" name="Submit" value="Submit">
<?php
if(isset( $Submit ))
{
//If the Submitbutton was pressed do:
if ($_FILES['imagefile']['type'] == "image/gif"){
copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name'])
or die ("Could not copy");
echo "<br>";
echo "Name: ".$_FILES['imagefile']['name']."<br>";
echo "Size: ".$_FILES['imagefile']['size']."<br>";
echo "Type: ".$_FILES['imagefile']['type']."<br>";
echo "Copy Done....";
}
else {
echo "<br><br>";
echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>";
}
}
?> </form> |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Aug 17, 2006 11:57 pm Post subject: |
|
|
Thanks. I need it to be command line, so looking at it I can just modify it so I can pass the file name to the script, right?
upload.php?Submit="filename" _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Aug 18, 2006 12:59 am Post subject: |
|
|
Oh, gotcha. Perhaps you could use a hidden browser element, or one placed
off the visible dialog box, load a form for submitting the file, then send to the
browser the file path and then submit to the script.
That's the only way I can think of off the top of my head right now. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Mon Feb 26, 2007 6:09 pm Post subject: |
|
|
I want to try automating sending a file to my site using vdsipp.dll or else with an auto-submitted form in a hidden browser element.
I don't know much HTML. In the example above, FF, is it supposed to be split into two files - the .HTM form and a PHP script? I'm confused about how to test it. _________________ Joe Floyd |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 27, 2007 3:11 am Post subject: |
|
|
chris wrote
| Quote: | | I don't want to have to setup FTP for every user just to upload a file/image. |
just a thought ... i use filezilla as my ftp program and it allows me to set up any number of ftp accounts by customer name ... uploading files for a specific customer is very easy ... 2 clicks to establish an ftp connection and then click and drag to upload the files
serge _________________
|
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Feb 27, 2007 3:46 pm Post subject: |
|
|
Thanks, but I need to do it via VDS. I ended up making an FTP account and using it. That project is on hold now anyway. Thanks again for the ideas. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
|