Progress Bar - PHP Ajax File Uploader (Images and Zip/Rar files)
€8-30 EUR
已关闭
已发布超过 1 年前
€8-30 EUR
货到付款
Hello right now I've a website that I use to Upload files to Amazon S3 Bucket I own, I'd like to add a progress bar to check the percentage and status of my uploading to the Amazon S3 Bucket.
This is the form and PHP code I'm using right now to accomplish the uploading
FORM :
--------------
<form id="contact-form" action="[login to view URL]" method="post" name="frmImage" enctype="multipart/form-data">
<input class="file-input" type="file" style="width:100%;"autocomplete="off" name="ftp" accept="image/*, .zip, .rar, .bzip" onchange="[login to view URL]();changeStyle()" class="file-up" id="fileFTP">
</form>
-------------
PHP TO UPLOAD:
-----------
<?php
require './aws/[login to view URL]';
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
// AWS Info
$bucketName = '****';
$IAM_KEY = '*****';
$IAM_SECRET = '*****';
// Connect to AWS
try {
// You may need to change the region. It will say in the URL when the bucket is open
// and on creation. us-east-2 is Ohio, us-east-1 is North Virgina
$s3 = S3Client::factory(array(
'credentials' => array(
'key' => $IAM_KEY,
'secret' => $IAM_SECRET
),
'version' => 'latest',
'region' => 'eu-west-1'
));
}
catch (Exception $e) {
die("Error: " . $e->getMessage());
}
// For this, I would generate a unqiue random string for the key name. But you can do whatever.
//$target_file = 'f/' . basename($_FILES["ftp"]['tmp_name']); //ftp is file name at [login to view URL]
if (isset($_FILES["ftp"]) && $_FILES["ftp"]["error"] == 0) {
$mimeType = mime_content_type($_FILES["ftp"]["tmp_name"]);
$fileSize = $_FILES["ftp"]["size"];
if (strpos($mimeType, "image") === 0) {
if ($fileSize <= 1000 * 1024 * 1024) { //max image size
$target_dir = "i/";
// $strng = preg_replace("/[\s-]|\#/", "_", basename($_FILES["ftp"]["name"])); //Prima era solo "/[\s-]/"
$target_file = $target_dir . time() . rand(100, 999);
//$pathInS3 = '[login to view URL]' . $bucketName . '/' . $target_file;
// Add it to S3
try {
if (!file_exists('/tmp/tmpfile')) {
echo 3;
mkdir('/tmp/tmpfile');
}
$tempFilePath = '/tmp/tmpfile/' . basename($_FILES["ftp"]['name']);
$tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file.");
$fileContents = file_get_contents($_FILES["ftp"]['tmp_name']);
$tempFile = file_put_contents($tempFilePath, $fileContents);
$s3->putObject(array(
'Bucket' => $bucketName,
'Key' => $target_file,
'SourceFile' => $tempFilePath,
'StorageClass' => 'REDUCED_REDUNDANCY',
'ACL' => 'public-read'
));
$valPOutput = htmlspecialchars($target_file);
header('HTTP/1.1 303 See Other');
header('Location: [login to view URL]' . "?p=" . $valPOutput);
}
catch (S3Exception $e) {
die('Error:' . $e->getMessage());
}
catch (Exception $e) {
die('Error:' . $e->getMessage());
}
} else {
echo "image too big";
}
} elseif ($mimeType == "application/zip" || $mimeType == "application/x-rar-compressed" || $mimeType ==
COULD NOT UPLOAD ALL PHP CAUSE OF MAX CHARS
Tried to do but encountered the problem that when calling the form I get redirected to [login to view URL] and Javascript etc stop working.!!!!
I do not want to add a button to submit the form, everything must stay the same, only need to add a Progress Bar.
Hello hiring member i am bhavika i have 6+years experience in php, laravel ,ajax, jquery , javascript, html ,css, bootstrap i have done many project with this all skill i can start this right now so please give me chance to serve you thanks in advance :)
Hello, I'm Abu Gosia.
I'm interesting in your project very well.
I'm good in C#, .Net Core, MVC, ASP.NET, Angular.js, Yii2, PHP, Laravel, Codeigneter, Wordpress, Open Cart.
I m quite well experienced in these jobs.
Let's go ahead with me.
Thanks
Hello,
I have gone through your outsourced requirements " Progress Bar - PHP Ajax File Uploader (Images and Zip/Rar files) " and have analyzed that I have right skills ( PHP JavaScript AJAX CSS ) to execute your esteemed project. I will complete your project today, LIFETIME error free guarantee and provide 365 days (ONE YEAR) support...
=====
Why choose me?
=====
5.0 / 5.0 rating,
100% completion rate,
100% on-time completion,
100% on-budget :)
Kindly, check my profile: http://www.freelancer.com/u/BitLabs.html
I work smart, hard, and strictly bid only what we can do! No sub-contracting... ever!
You will never go wrong choosing me :)
Hope you are doing well!
Thanks for your job post, it's so interesting for me. I have more than 8 years of experience of web development and will be happy to help you with your project!
I am willing to offer great rates and good quality, which I will be personally in charge of. Is this kind of partnership interesting to you?
Looking forward to hearing from you.
Best, Anton.
Thanks for taking the time to view my bid.
As mentioned in the details of the project about the requirement => I CHECK YOUR CODE. OKAY I GOT IT. I can add a progress bar for you to upload a file on aws.
I CAN DO THIS FOR YOU IN VERY LOW COST ||. <CHAT WITH ME> ||
I have some questions about your project, after which I can get started right away. It would be a pleasure to work with you on this project.
I HAVE JUST JOINED AS A FREELANCER, BUT I HAVE YEARS OF EXPERIENCE WORKING IN THE IT INDUSTRY.
For now, ignore the bid amount, as we still need to discuss thru' chat & finalize the scope of work.
Look forward to hearing from you thru' chat.
➽ I'm a certified developer with a 5-star rating. If you would like to discuss the project and budget in more detail, please send me a message.
Regards
VINITA P
Hi, Dear client!
I am a web developer with 4 years of experience in PHP, Nodejs, React.js and Django.
The best quality and accurate timeline is what I guarantee you.
If I am engaged in this project, I will surely make you happy .
I am looking forward to hearing from you soon.
Best regards.
Jaime.
Hello, this is Rahil from Pakistan who has been working with web development for over 10 years now. I have checked your project carefully and I think that I can help you to complete this project 100% perfectly sure to satisfy your requirement. I'd like to have a brief chat or call to discuss further details about your project soon.
Looking forward to working with you together on this project.
Thanks!
Hello
I would be very happy to help you and provide you with best possible virtual assistant services right away.
I hope to hear back from you as soon as possible my friend.
Hi, I have read your description carefully.
I have full experience with PHP.
And I can carry out your task on time high quality. please, contact me.
from @Marcelo H.
Hello. Hope you are doing well.
As a PHP expert, I am sure to fix that issue when upload.
I am able to add only progress bar.
Let's get started now.
Best regards.