Automatically grab file path -
everyone looking way automatically upload file skip browse , choose file process.
so set location of file somehow via form , client has click submit , automatcially upload file path have set. skipping browse file process.
i intergrate following undesigns s3 class
http://undesigned.org.za/2007/10/22/amazon-s3-php-class/documentation
<?php s3::setauth(awsaccesskey, awssecretkey); $bucket = "upload-bucket"; $path = "myfiles/"; // can empty "" $lifetime = 3600; // period parameters valid $maxfilesize = (1024 * 1024 * 50); // 50 mb $metaheaders = array("uid" => 123); $requestheaders = array( "content-type" => "application/octet-stream", "content-disposition" => 'attachment; filename=${filename}' ); $params = s3::gethttpuploadpostparams( $bucket, $path, s3::acl_public_read, $lifetime, $maxfilesize, 201, // or url redirect on success $metaheaders, $requestheaders, false // false since we're not using flash ); $uploadurl = "https://{$bucket}.s3.amazonaws.com/"; ?><!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>s3 form upload</title> </head> <body> <form method="post" action="<?php echo $uploadurl; ?>" enctype="multipart/form-data"> <?php foreach ($params $p => $v) echo " <input type=\"hidden\" name=\"{$p}\" value=\"{$v}\" />\n"; ?> <input type="file" name="file" /> <input type="submit" value="upload" /> </form> </body> </html>
at point grab file path ?
is grabbing out of name here
can $_files ???
can please give me point on start appriciate this.
thanks
you'll have specify tools of trade. common html form has no such functionality.
you can try value="c:\somefile.ext" many browsers not accept this.
Comments
Post a Comment