I got error when upload file(contact form 7)

I use contact form 7 and it is not usable on product page but if I go to function.php file on my site-theme and write this code over there;

add_action( 'woocommerce_before_add_to_cart_button' , 'my_upload_file_thing' );    function my_upload_file_thing(){       echo do_shortcode('[contact-form-7 id="545" title="file-upload"]');      } 

when I write this code, it seems on product page but when i go upload something as a client, i get error. but when I normally use this plugin, I do not get error.

What conditions must be met in order to upload .zip file to a multisite WordPress installation?

I cannot upload .zip files to my WordPress network, despite making IMHO everything that is needed. I am still hit by this irritating error.

enter image description here

Details:

  1. I am a super-admin in my network.
  2. The ALLOW_UNFILTERED_UPLOADS flag is set to true
  3. Custom hook of $ existing_mimes['zip'] = 'application/zip'; is added
  4. Uploading .zip files is allowed in my network:

enter image description here

Here is entire code of my hook:

function so_387865_custom_upload_mimes ( $  existing_mimes ) {     $  existing_mimes['epub'] = 'application/epub+zip';     $  existing_mimes['mobi'] = 'application/x-mobipocket-ebook';     $  existing_mimes['zip'] = 'application/zip';       return $  existing_mimes; }   add_filter('upload_mimes', 'so_387865_custom_upload_mimes'); 

I thought that maybe there’s something wrong with the hook, so I have installed the Enhanced Media Library extension (as suggested in here). All for nothing, as it clearly shows that this MIME type is added:

enter image description here

What else should I do in order to be able to upload .zip files? I am seriously lost!

Build up your traffic! Upload your videos to more than 220 tube sites now!

Upload Your Video To Hundreds Tube Sites In Just Minutes!

Auto creation of profiles on tube sites, Auto and Manual upload of  videos to hundreds of tube sites!

The Tube Sites Submitter is a fast and efficient tool for anyone who needs to upload videos quickly, easily and automatically to hundreds of tube sites in mere minutes. Tube Sites Submitter takes only minutes to create profiles on tube sites and upload your video automatically to the tube sites included in the database which is part of the Tube Sites Submitter.

The Tube Sites Submitter will:
– upload your video to hundreds of tube sites
– register your profile on hundreds of tube sites
– make sure your video is seen by tens of thousands of users
– increase traffic to your sites
– boost your earnings
– save you a lot of time
– make your work more efficient

The Tube Sites Submitter contains a database of tube sites and their rules.
BUY TUBE SITES SUBMITTER NOW! / TRY DEMO ( Watch this tutorial )

– there are more than 200 categories and a video can be uploaded to as many as 6 niche categories
– you can create an unlimited number of profiles
– proxy settings for individual profiles
– upload to hundreds of tube sites
– an easy-to-use password manager for your passwords
– attach descriptions of different size to the same video
– upload videos including the 2257 info
– upload videos including full video data (video duration, file size, format…)
– upload different video types (wmv, mpg, mp4, mov, flv, avi etc, etc.)
– upload videos with tags
– uploading videos with content-type information is fully supported

Start building traffic and making money right now!

Upload file to Woocommerce Order

I’m trying to add File Upload for checkout process. Here is my code:

Add input after order notes

add_filter( 'woocommerce_after_order_notes', 'upload_file_checkout' ); function upload_file_checkout() {      ?>          <p class="form-row" id="image" data-priority="">         <label for="image" class="">Image (JPG, PNG, PDF)</label>         <span class="woocommerce-input-wrapper">         <input type='file' name='image' accept='image/*,.pdf' multiple='false'>         </span>     </p>         <?php } 

Next, update order meta

add_action( 'woocommerce_checkout_update_order_meta', 'checkout_file_update_order_meta' ); function checkout_file_update_order_meta($  order_id) {              if ( isset( $  _POST['image'] ) ) {                  require_once( ABSPATH . 'wp-admin/includes/image.php' );         require_once( ABSPATH . 'wp-admin/includes/file.php' );         require_once( ABSPATH . 'wp-admin/includes/media.php' );                  $  attachment_id = media_handle_upload( 'image', $  order_id );          update_post_meta( $  order_id, '_image', $  attachment_id );      }      } 

And show the result in admin page

add_action( 'woocommerce_admin_order_data_after_billing_address', 'show_new_checkout_field_order', 10, 1 );     function show_new_checkout_field_order( $  order ) {        $  order_id = $  order->get_id();    echo '<p><strong>Image:</strong> ' . get_post_meta( $  order_id, '_image', true ) . '</p>'; } 

But this is not work. How can I fix it?

This is how I see this meta in DB after place an order

enter image description here

Upload Gravity Form files to OneDrive [closed]

I’ve been looking for an away of upload files from Gravity Form direct to the cloud on OneDrive. And so far, I found some codes that could be useful:

 add_filter( 'gform_upload_path', function ( $  path_info, $  form_id ) {         GFCommon::log_debug( "log_upload_path(): path_info for form #{$  form_id} => " . print_r( $  path_info, true ) );               return $  path_info;     }, 1, 2 );       add_filter( 'gform_upload_path', 'change_upload_path', 10, 2 ); function change_upload_path( $  path_info, $  form_id ) {    $  path_info['path'] = '/home/public_html/yourdomainfolder/new/path/';    $  path_info['url'] = 'http://yourdomainhere.com/new/path/';    return $  path_info; }    <?php require_once 'functions.inc.php'; $  token = skydrive_tokenstore::acquire_token(); // Call this function to grab a current access_token, or false if none is available.  if (!$  token) { // If no token, prompt to login. Call skydrive_auth::build_oauth_url() to get the redirect URL.        echo "<div>";        echo "<img src='statics/key-icon.png'>&nbsp";        echo "<a href='" . skydrive_auth::build_oauth_url() . "'>Login with SkyDrive</a></span>";        echo "</div>"; } else {        $  sd = new skydrive($  token);        try {            $  response = $  sd->put_file($  _GET['folderid'], '/file/to/put');            // File was uploaded, return metadata.            print_r($  response);        } catch (Exception $  e) {            // An error occured, print HTTP status code and description.            echo "Error: ".$  e->getMessage();            exit;        } } 

Source: https://docs.gravityforms.com/gform_upload_path/
https://stackoverrun.com/fr/q/8253794

Instead of my domain path I would like to point it to one folder on Onedrive and if possible, generate a new folder for each upload containing the current WooCommerce order number. I don’t have much experience with PHP so any useful help will be great!

how to split and upload a theme on wordpress?

I have created an account on googiehost and unfortunately the hosting company has limited the file upload size to 2MB. Since the hosting is free on googiehost the hosting provider may not agree to increase the file upload size for just my account. And now i have this Divi theme which is 8 MB in size and i am unable to upload it due to the limit. So i thought off splitting the Divi.zip file into 4 X 2MB chunks which later makes up 8MB(The theme) and then give to any plugin so that it takes all the chunks and extract them to the path where the theme is actually supposed to be installed. So my question is there any plugin as such which does what i want.

How to upload a prepared html page on Google sites?

In order to create an html page using Google sites, there are some tools and templates in the Google sites itself; however, I did not find an option for uploading an html page (site) that has been created already (outside of Google sites).

Is there any possibility for this purpose ?

I tested Embed option, but it is not what I want, as the embedded html will cover only a part the screen …

P.S. This html page is not a part of website, but it is a whole of website. (The website is a single html page.)

Upload Image Remotely from Rest API using JWT Authorization INVALID_AUTHORIZATION_HEADER_TOKEN_TYPE

Trying to upload images into my media gallery programatically from my local machine to webserver.

Using this function here to get the JWT token along with the
WordPress REST API Authentication plugin to initialize JWT:

function get_jwt_token_wp(): ?string {     $  request_url = 'https://example.com/wp-json/api/v1/token';      $  api = curl_init();      $  username = 'admin';     $  password = 'password';     //set the url, POST data     curl_setopt( $  api, CURLOPT_URL, $  request_url );     curl_setopt( $  api, CURLOPT_POST, 1 );     curl_setopt( $  api, CURLOPT_POSTFIELDS, "username=$  username&password=$  password" );     curl_setopt( $  api, CURLOPT_VERBOSE, 1);     curl_setopt( $  api, CURLOPT_RETURNTRANSFER, 1 );      $  server_output = curl_exec ($  api);     printr(curl_getinfo($  api));     if ($  server_output === false) {         die('Error getting JWT token on WordPress for API integration.');     }     $  server_output = json_decode($  server_output);      if ($  server_output === null && json_last_error() !== JSON_ERROR_NONE) {         die('Invalid response getting JWT token on WordPress for API integration.');     }      if (!empty($  server_output->jwt_token)) {         $  jwt_token = $  server_output->jwt_token;         curl_close ($  api);         return $  jwt_token;     } else {         die('Invalid response getting JWT token on WordPress for API integration.');     }     return null; } 

and this function to upload the image

function upload_image_wp( $  path ): array {     $  request_url = 'https://example.com/wp-json/wp/v2/media';      $  image = file_get_contents( $  path );     $  mime_type = mime_content_type( $  path );      $  api = curl_init();      $  username = 'admin';     $  password = 'password';      $  httpheader = array( 'Content-Type: ' . $  mime_type, 'Content-Disposition: attachment; filename="' . basename($  path) . '"', 'Authorization' => 'Bearer ' . WOO_JWT_KEY );      curl_setopt( $  api, CURLOPT_URL, $  request_url );     curl_setopt( $  api, CURLOPT_POST, 1 );     curl_setopt( $  api, CURLOPT_POSTFIELDS, $  image );     curl_setopt( $  api, CURLOPT_HTTPHEADER, $  httpheader );     curl_setopt( $  api, CURLOPT_VERBOSE, 1);     curl_setopt( $  api, CURLOPT_RETURNTRANSFER, 1 );     curl_setopt( $  api, CURLOPT_USERPWD, $  username . ':' . $  password );     $  result = curl_exec( $  api );     printr(curl_getinfo($  api));     curl_close( $  api );     return json_decode( $  result ); } 

with my headers looking something like this:

Array (     [0] => Content-Type: image/gif     [1] => Content-Disposition: attachment; filename="user_loggedin_avatar.gif"     [Authorization] => Bearer eyJhbGciOiJIU..................................... ) 

Is my format wrong? Am I doing something else wrong? I have never worked with JWT authentication before so this has all been new to me.

This is the error I am getting on the return of my call.

object(stdClass)[3]   public 'status' => string 'error' (length=5)   public 'error' => string 'INVALID_AUTHORIZATION_HEADER_TOKEN_TYPE' (length=39)   public 'code' => string '401' (length=3)   public 'error_description' => string 'Authorization header must be type of Bearer Token.' (length=50) 

Unfortunately google isn’t showing much of anything regarding why this error pops up, so I am a bit stuck. Any help greatly appreciated!

Self-XSS From File Upload Name

I encountered this type of vulnerability a couple of times but weren’t able to fully exploit it, need help! This vulnerability is self-xss which is triggered from file names. E.g. If I were to upload a file named ‘[xss-payload].png’, it will be executed as javascript and the window will prompt ‘1’. But it only goes as far as that, the file name stored in the server is randomly generated, therefore this isn’t a stored xss. Is there anyway I could exploit this? The Javascript is executed when uploading the file only. I tried chaining with Clickjacking, but website doesn’t allow iframe. And from what I heard, CSRF is not possible since setting a ‘pre-filled’ file name is not possible when uploading a file. Any idea where I should go with this? Can I chain this with other vulnerabilities? Thank you all.

[XSS-Payload] = Any XSS payload as file name will be executed when uploading the file

E.g. File Name: <img src=x onerror=alert(1)>.png