
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/ChatGPT%20Image%20Mar%2016%2C%202026%2C%2012_11_41%20PM_0.png" />
Blending expert teaching with smart digital learning
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
38+ Years of Legacy
Proven Aakash pedagogy with All-India benchmarking.
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
2-Way Live Interactive Classes
Real-time engagement, daily practice, tests & AI test analytics
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%284%29.png">
360° Complete Student Care
Live & AI doubt solving, personal mentors & regular PTMs
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%282%29.png" />
Personalised Support
1-1 Monitoring and on demand personal support
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%283%29.png" />
Exclusive Study Material
Printed study packages directly deliver to your international doorstep.
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector.png">
Rigorous Testing
Phase wise and All India Test Series
Choose the perfect course that matches your academic level and preparation needs.
NEETJEEFoundation
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/class%2011%20-%20neet.png" />
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Two-way live interactive classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
100+ Tests | NEET-Pattern CBTs
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Study Material comprising 27500+ practice Questions
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
NEET Prep along with School
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/NEET-12.jpg" />
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Two-way live interactive classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
70+ Tests | NEET-Pattern CBTs
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Study Material comprising 27500+ practice Questions
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
NEET Prep along with School
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/NEET-Top-image.jpg" />
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Two way Live Interactive classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
70+ Tests | NEET-Pattern CBTs
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Study Material 27675+ practice Questions
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Concept Strengthening Classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/jee-11.jpg" />
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Live Interactive Classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
JEE prep along with School
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Regular Assessments
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Complete Study Material
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/JEE-12.jpg" />
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Live Interactive Classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
JEE prep along with Board Exams
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
JEE Main & Advanced Pattern Tests
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> ">
Personalised Support
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/JEE%20repeatr%3Der%20course.png" />
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> ">
Advanced JEE Classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> ">
Concept Strengthening & Problem Solving Focus
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> ">
Test Series for JEE Mains & Advanced
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Personal Mentoring
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Integrated%20CBSE.png" />
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%281%29.png">
School/Board focused classes
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%285%29.png">
Comprehensive Study Material
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%286%29.png">
Basic/Advanced Olympiad Preparation
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%287%29.png">
Regular Online PTM's and Monthly Progress Report
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Integrated%20ICSE.png" />

ICSE Board aligned Classes

Class Wise Notes and Recordings

Basic/ Advanced Olympiad Preparation

ICSE Specific Testing Pattern
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/School%20%2B%20cbse.png" />

Basic Olympiads Preparation

Daily Homework (DPPs)

360° Student Care

Focus on subjective assessments
Get Personalised Counselling Session
Sign up now
Comprehensive preparation platform combining expert guidance with cutting edge technology
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%289%29.png" />
Interactive live sessions with expert faculty
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%2810%29.png" />
24x7 access to comprehensive video library
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%2811%29.png" />
Get your doubts resolved instantly by expert mentors
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%2812%29.png" />
Regular practice tests to strengthen your preparation
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%2813%29.png" />
AI powered analysis of your learning journey
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Vector%20%2814%29.png" />
Regular detailed reports on student progress
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/What%20will%20you%20get.png" />
Your dream deserves the best preparation. Start today with Aakash Gulf Country Courses' proven guidance and smart learning tools.
Register Now
Meet the students who made it to the top
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Uplakshya-Goyal.jpg" />
AIR 3
NEET 2026
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Aryan-Dubey.jpg" />
AIR 7
NEET 2026
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Geetansh-Sarin.jpg" />
AIR 8
NEET 2026
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Krish-Gupta.jpg" />
AIR 15
NEET 2026
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Mohit_Shekher_Shukla.webp" />
AIR 4
JEE Advanced 2026
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Aarav_Gupta.webp" />
AIR 17
JEE Advanced 2026
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/Utkarsh_Khokhar.webp" />
AIR 35
JEE Advanced 2026
getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src="https://dcx0p3on5z8dw.cloudfront.net/Aakash/s3fs-public/pdf_management_files/target_solutions/SNEHAL_ROY_CHOUDHURY.webp" />
AIR 41
JEE Advanced 2026
Start your preparation
What is the Aakash Digital International Online Classroom Program? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
The Aakash Digital International Online Classroom Program is a specialized, interactive digital learning platform designed for students living abroad who aspire to excel in Indian competitive entrance exams (NEET-UG, JEE Main & Advanced), National/International Olympiads, and CBSE/ICSE school board examinations.
Which courses are available for International students? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Aakash Digital offers comprehensive Live Online Classroom Programs for:● NEET-UG Preparation (Grades 11–12 & Repeaters)● JEE Main & Advanced Preparation (Grades 11–12 & Repeaters)● Foundation & Olympiads (Grades 6–10)
How are class schedules structured for International students? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
We offer multiple live batch options aligned with Indian Standard Time (IST) for NEET, JEE, and Foundation courses. Students can choose a batch schedule that best aligns with their school hours and local time zone for seamless learning.
How are online classes conducted, and which platform is used? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Classes are delivered seamlessly through Aakash Digital Platform, myAakash (accessible via web portal and mobile app). The platform integrates live video streaming, real-time two-way interaction tools, digital whiteboards, automated attendance tracking, and access to live class notes and recordings after every class.
What happens if a student misses a Live Online Class due to school or personal commitments? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Every live class is recorded and uploaded to the student portal within 24 hours. Students get 24/7 access to the video library along with lecture notes, daily homework, and study materials for easy revision anytime.
How does Aakash Digital help international students compete with students in India? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " />
Students participate in the All India Aakash Test Series (AIATS) and regular assessment tests alongside lakhs of students across India. This gives international students an authentic All-India Rank (AIR) and comparative performance analytics to understand where they stand nationally.
What study material is provided, and how is it delivered to International addresses? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> ">
Students receive Aakash’s world-renowned printed study packages delivered directly to their international doorstep. Additionally, all study materials, revision modules, assignment sheets, and eBooks are accessible digitally on the student dashboard.
What does the 360° Student Care system at Aakash Digital include? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> ">
Our 360° Student Care framework is designed to support international students both academically and non-academically. It includes dedicated personal mentorship, regular Parent-Teacher Meetings (PTM’s), a specialized Parent View on myAakash, monthly progress tracking, and multi-channel student support.
How are student doubts resolved in the Aakash Digital International Program? getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> " src=" // 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' => 'ap-south-1' ) ); } catch (Exception $e) { // We use a die, so if this fails. It stops here. Typically this is a REST call so this would // return a json object. die("Error: " . $e->getMessage()); } $fileURL = $_GET['data']; $filetitle =$_GET['titletxt']; if(empty($filetitle)){ $filetitle="aakash"; } //random number $aakrandomno=rand(); // For this, I would generate a unqiue random string for the key name. But you can do whatever. $keyName = 'inline-images/'.$filetitle."_".$aakrandomno.'.png' ; // Add it to S3 try { // You need a local copy of the image to upload. // My solution: http://stackoverflow.com/questions/21004691/downloading-a-file-and-saving-it-locally-with-php if (!file_exists('/tmp/tmpfile')) { mkdir('/tmp/tmpfile'); } $tempFilePath = '/tmp/tmpfile/' . basename($fileURL); $tempFile = fopen($tempFilePath, "w") or die("Error: Unable to open file."); $fileContents = file_get_contents($fileURL); $tempFile = file_put_contents($tempFilePath, $fileContents); $s3->putObject( array( 'Bucket'=>$bucketName, 'Key' => $keyName, 'SourceFile' => $tempFilePath, 'ACL' => 'public-read' ) ); // WARNING: You are downloading a file to your local server then uploading // it to the S3 Bucket. You should delete it from this server. // $tempFilePath - This is the local file path. //echo 'https://d29zwu34e1ouns.cloudfront.net/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; echo 'https://resources-sit.aakash.ac.in/inline-images/'.$filetitle.'_'.$aakrandomno.'.png'; } catch (S3Exception $e) { echo $fileURL; } catch (Exception $e) { echo $fileURL; } // Now that you have it working, I recommend adding some checks on the files. // Example: Max size, allowed file types, etc. ?> ">
Aakash Digital provides a comprehensive, multi-channel doubt resolution ecosystem through 5 powerful resolution methods:1. In-Class Live Chat: Ask questions instantly via text chat during live interactive lectures.2. "Raise Hand" Audio Interaction: Speak directly with expert faculty during live classes for real-time concept clarification.3. Daily Live Doubt Sessions: Dedicated interactive doubt-clearing sessions conducted Monday through Saturday outside regular class hours.4. 24/7 AI-Enabled "Ask a Doubt": Submit text or image-based doubts anytime via the myAakash app or portal for instant, step-by-step solutions.5. QR Code Video Solutions: Scan embedded QR codes in the printed study materials to watch step-by-step video solutions for complex practice problems.
Is a dedicated personal mentor assigned to international students? 
Yes. Every student enrolled in an Aakash Digital International course is assigned a dedicated Personal Mentor. Mentors offer one-on-one guidance for both academic planning (study schedules, goal setting, exam strategies) and non-academic support.
Are Parent-Teacher Meetings (PTMs) conducted for international parents? 
Yes. Online PTMs are organized regularly to keep parents fully connected with the academic journey. During PTMs, mentors and faculty discuss the student’s academic progress, attendance, test performance, and personalized improvement strategies.
How can students or parents get help if they encounter technical, operational, or academic issues? 
We offer multiple channels for immediate support and query resolution:1. Dedicated Helpline: Direct student support number for quick resolution of operational or technical queries.2. Direct Mentor Connect: Call or message your assigned Personal Mentor for academic or schedule guidance.3. In-App Query Portal: Raise a ticket directly via the myAakash App.4. Email Support: Reach our international helpdesk (01140850372) via email (care.aakashdigtial@aesl.in) for detailed assistance.