forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


HTTP Upload

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Aug 15, 2006 6:57 pm    Post subject: HTTP Upload Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Wed Aug 16, 2006 3:12 am    Post subject: Reply with quote

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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed Aug 16, 2006 8:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Wed Aug 16, 2006 10:43 pm    Post subject: Reply with quote

I don't have one, but check http://php.resourceindex.com, there are several php scripts available.
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed Aug 16, 2006 10:57 pm    Post subject: Reply with quote

Thanks, I'll take a look.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Aug 17, 2006 11:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Aug 17, 2006 11:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 18, 2006 12:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Mon Feb 26, 2007 6:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 27, 2007 3:11 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Feb 27, 2007 3:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group