Uploading a file from local folder to share point folder through REST APIs

I am creating a client application where I need to upload file from local folder to share point folder. I am following https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/upload-a-file-by-using-the-rest-api-and-jquery

  <html>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
    <script>
'use strict';
var appWebUrl, hostWebUrl;

jQuery(document).ready(function () {
  // Check for FileReader API (HTML5) support.
  if (!window.FileReader) {
    alert('This browser does not support the FileReader API.');
  }

  // Get the add-in web and host web URLs.
  appWebUrl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
  hostWebUrl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
});

// Upload the file.
// You can upload files up to 2 GB with the REST API.
function uploadFile() {
  // Define the folder path for this example.
  var serverRelativeUrlToFolder = 'shared documents';

  // Get test values from the file input and text input page controls.
  // The display name must be unique every time you run the example.
  var fileInput = jQuery('#getFile');
  var newName = jQuery('#displayName').val();

  // Initiate method calls using jQuery promises.
  // Get the local file as an array buffer.
  var getFile = getFileBuffer();

  getFile.done(function (arrayBuffer) {
    // Add the file to the SharePoint folder.
    var addFile = addFileToFolder(arrayBuffer);
    addFile.done(function (file, status, xhr) {
      // Get the list item that corresponds to the uploaded file.
      var getItem = getListItem(file.d.ListItemAllFields.__deferred.uri);
      getItem.done(function (listItem, status, xhr) {
        // Change the display name and title of the list item.
        var changeItem = updateListItem(listItem.d.__metadata);
        changeItem.done(function (data, status, xhr) {
          alert('file uploaded and updated');
        });
        changeItem.fail(onError);
      });
      getItem.fail(onError);
    });
    addFile.fail(onError);
  });

  getFile.fail(onError);

  // Get the local file as an array buffer.
  function getFileBuffer() {
    var deferred = jQuery.Deferred();
    var reader = new FileReader();
    reader.onloadend = function (e) {
      deferred.resolve(e.target.result);
    }
    reader.onerror = function (e) {
      deferred.reject(e.target.error);
    }
    reader.readAsArrayBuffer(fileInput[0].files[0]);
    return deferred.promise();
  }

  // Add the file to the file collection in the Shared Documents folder.
  function addFileToFolder(arrayBuffer) {
    // Get the file name from the file input control on the page.
    var parts = fileInput[0].value.split('\');
    var fileName = parts[parts.length - 1];

    // Construct the endpoint.
    var fileCollectionEndpoint = String.format(
        "{0}/_api/sp.appcontextsite(@target)/web/getfolderbyserverrelativeurl('{1}')/files" +
        "/add(overwrite=true, url='{2}')?@target='{3}'",
        appWebUrl, serverRelativeUrlToFolder, fileName, hostWebUrl);

    // Send the request and return the response.
    // This call returns the SharePoint file.
    return jQuery.ajax({
      url: fileCollectionEndpoint,
      type: "POST",
      data: arrayBuffer,
      processData: false,
      headers: {
        "accept": "application/json;odata=verbose",
        "X-RequestDigest": jQuery("#__REQUESTDIGEST").val(),
        "content-length": arrayBuffer.byteLength
      }
    });
  }

  // Get the list item that corresponds to the file by calling the file's ListItemAllFields property.
  function getListItem(fileListItemUri) {
    // Construct the endpoint.
    // The list item URI uses the host web, but the cross-domain call is sent to the
    // add-in web and specifies the host web as the context site.
    fileListItemUri = fileListItemUri.replace(hostWebUrl, '{0}');
    fileListItemUri = fileListItemUri.replace('_api/Web', '_api/sp.appcontextsite(@target)/web');

    var listItemAllFieldsEndpoint = String.format(fileListItemUri + "?@target='{1}'", appWebUrl, hostWebUrl);

    // Send the request and return the response.
    return jQuery.ajax({
      url: listItemAllFieldsEndpoint,
      type: "GET",
      headers: { "accept": "application/json;odata=verbose" }
    });
  }

  // Change the display name and title of the list item.
  function updateListItem(itemMetadata) {
    // Construct the endpoint.
    // Specify the host web as the context site.
    var listItemUri = itemMetadata.uri.replace('_api/Web', '_api/sp.appcontextsite(@target)/web');
    var listItemEndpoint = String.format(listItemUri + "?@target='{0}'", hostWebUrl);

    // Define the list item changes. Use the FileLeafRef property to change the display name.
    // For simplicity, also use the name as the title.
    // The example gets the list item type from the item's metadata, but you can also get it from the
    // ListItemEntityTypeFullName property of the list.
    var body = String.format("{{'__metadata':{{'type':'{0}'}},'FileLeafRef':'{1}','Title':'{2}'}}",
        itemMetadata.type, newName, newName);

    // Send the request and return the promise.
    // This call does not return response content from the server.
    return jQuery.ajax({
      url: listItemEndpoint,
      type: "POST",
      data: body,
      headers: {
        "X-RequestDigest": jQuery("#__REQUESTDIGEST").val(),
        "content-type": "application/json;odata=verbose",
        "content-length": body.length,
        "IF-MATCH": itemMetadata.etag,
        "X-HTTP-Method": "MERGE"
      }
    });
  }
}

// Display error messages.
function onError(error) {
  alert(error.responseText);
}

// Get parameters from the query string.
// For production purposes you may want to use a library to handle the query string.
function getQueryStringParameter(paramToRetrieve) {
  var params = document.URL.split("?")[1].split("&amp;");
  for (var i = 0; i < params.length; i = i + 1) {
    var singleParam = params[i].split("=");
    if (singleParam[0] == paramToRetrieve) return singleParam[1];
  }
}
    
    
    </script>   


<input id="getFile" type="file"/><br />
<input id="displayName" type="text" value="Enter a unique name" /><br />
<input id="addFileButton" type="button" value="Upload" onclick="uploadFile()"/>
</html>

I get this error message
ERROR MESSAGE

Where should I specify share point folder location path. How to give access to it?

 var fileCollectionEndpoint = String.format(
        "{0}/_api/sp.appcontextsite(@target)/web/getfolderbyserverrelativeurl('{1}')/files" +
        "/add(overwrite=true, url='{2}')?@target='{3}'",
        appWebUrl, serverRelativeUrlToFolder, fileName, hostWebUrl);

What casing do styled components use when passing attributes to the element

What casing do styled-components use when passing attributes to the element.

Lets say you have this HTML with attributes:

<div data-justin='my name' class='text' data-selected=false> </div>

              or a web-component like this:

<web-component a-long-attr-justin='my name' tons-of-data-selected=false> </div>

Then you have this as a styled component:

export const StyledComp = styled('div')

export const StyledComp = styled('web-component')

Now I have passed my attributes in kabob case. Question is when the styled component passes those given attributes back to the HTML element or web-component Element what casing is used? Is it Camel case, Pascal, snake case?

Should method return variable with $ or not: $words or words

keywords.extractKeywords().then(($words => {

          let i =$words.indexOf(word[0])
          expect(i,"Words inculdes the word").to.be.greaterThan(0)
          expect($words.includes(word[0],"word list includes word")).to.be.true
        
        })
      })

OR

keywords.extractKeywords().then((words => {

          let i =words.indexOf(word[0])
          expect(i,"Words inculdes the word").to.be.greaterThan(0)
          expect(words.includes(word[0],"word list includes word")).to.be.true
        
        })
      })

get dimensions of element without waiting for “recalculate style”

I am working on improving performance of some graphics intensive code, and one of the bottlenecks is that it sometimes needs to get the dimensions of a certain div. Most of the time this is fine, but occasionally it gets stuck for ~100ms waiting for the style to be recalculated.

Normally, I understand that we need to wait for the style to recalculate so that the dimensions returned are accurate, but this is causing it to pause for 100ms in the middle of an animation. I am okay with inaccurate or out of date metrics, as long as I can get them quickly. I don’t want to pause everything to recalculate the style.

Is there any way to avoid waiting for this recalculated style?

To summarize my use case: I am performing animations inside a canvas (with PIXI if anyone cares). The elements inside the canvas are arranged in rows that match up with HTML rows outside the canvas. Every time a canvas row is redrawn, we need to fetch the position and height of the external HTML row to figure out the height and top offset of the canvas row.

The HTML rows can change position and height, so the canvas rows need to be able to react to this. However, even when the HTML rows are not changing position or height, my canvas painting can get hung up for 100+ms waiting for a “recalculate style” to finish so that it can figure out it’s height and top offsets. I’m perfectly happy if it’s a little laggy when the rows change position and height (since it shouldn’t happen too often), but it shouldn’t mess up every animation of the rows contents to this extent.

REACT Component renders and then disappears

I have only one function that first gets the list of devices. the list is a JSON array. then the function loops over each element and request the shadow.

The function builds a new array using the device properties and the shadow property

The REACT page renders and show the data for a second, and then it disappears.

If I modify the getShadow function to just return the list of devices (without shadows), the page renders just fine. But the problem starts when I build the new array using the shadow data from each device.

Any idea what am I missing here?

many thanks

here is the code

async function getShadows() { 

    const listThings_command = new ListThingsCommand({});

    const data = await iotClient.send(listThings_command);  /* First get the list of things */ 
    const things = data.things;

    let devices_list = [];  // to store the final array with data to render

    let shadowRequests = things.map (thing => {   /* List calls to get shadow for each thing */ 

      return new Promise((resolve, reject) => {

        const getThingShadow_command = new GetThingShadowCommand({thingName: thing.thingName}); /** get device shadow */ 

        iotDataPlaneClient.send(getThingShadow_command).then(
          (data) => {

            const string_data = new TextDecoder('utf-8').decode(data.payload);  /* Decode payload as it is returned in Uint8Array format*/ 
            const shadow_data = JSON.parse(string_data);

            var deviceInfo = {  /* Create a new object to store required device info*/ 
              thingName : thing.thingName,
              thingTypeName: thing.thingTypeName,
              thingArn : thing.thingArn,
              shadow : shadow_data.state.reported
            };

            resolve(deviceInfo);
          },
          (error) => {

            reject(error);
          }
        ); 
      })
    })

    Promise.all(shadowRequests).then((data) => {
      data.forEach (res => {  /* loop over each promise */ 
        if (res) {
            devices_list.push(res); /* add the data as a new element in the array*/ 
        }
      })
    }
    )

    return devices_list;

  }; 
 
  function Home (){

    const [mydevices, updateMydevices] = React.useState([]);

    useEffect(() => {
      getShadows().then(data => updateMydevices(data)); 
    }, []);    


    return (
      <div className="App">
        <h1>Dashboard</h1> 
        <div>
          <h4>Devices List</h4>
          <ListGroup id="device_list">
              {
                mydevices.map((device, key) => {
                  return (
                    <ListGroup.Item key = {key}> 
                    <div>{device.thingName} </div>
                    </ListGroup.Item>
                  )
                })
              }
            </ListGroup>
        </div> 
      </div>
    );
  }
```


How to get the value from previous destroyed setInterval?

I have the following test application

https://stackblitz.com/edit/angular-upmaek?file=src%2Fapp%2Fcounter%2Fcounter.component.ts,src%2Fapp%2Fcounter%2Fcounter.component.css,src%2Fapp%2Fcounter%2Fcounter.component.html,src%2Fapp%2Fapp-routing.module.ts,src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html

as you can see i have two components hello-page and counter.
On counter component i have button and when i click on that button i am starting to have interval on every 1 second and i am increasing the value of the counter variable by one. You can see that in console.

After the incresing is started so 1,2,3 etc i click on hello-page link to go to HelloPageComponent.
When i am routed to that component the counter component is destroyed but we can see that the interval is still working from the counter component increasing the counter variable.

If i go back again to counter component i will see the counter 0 in the HTML VIEW but the counter in the interval is for example 10.

I guess it is like that because the view was detroyed and now we have the new view starting from the beggining with the initial value of counter of 0.

But i need to continue with the execution of the interval so whenever i go back to counter page, i need to have the counter value on HTML VIEW to be the same as the value in the console.
So if it will be 1- then when i go back i need to see 10 instead 0.

How can i do this ?

Webpack doesn’t load images from html and css

My images from .scss file are shown in “dist/images”, but they do not load on localhost. And images from html file ( kind) are not read at all, it seems to be loaded in “dist”, but not “dist/images” and it is not visible on the page.

Can anyone see what is incorrect in my config?

Here is the config:


const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");


const isProduction = process.env.NODE_ENV == "production";

const config = {
  entry: "./src/index.js",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "bundle.js",

  },
  devtool: "source-map",
  devServer: {
    open: true,
    host: "localhost",
    hot: true,
  },
  plugins: [new MiniCssExtractPlugin(),
    new CleanWebpackPlugin(),
    new HtmlWebpackPlugin({
      template: "index.html",
    }),
  ],
  
  module: {
    rules: [
      {
        test: /.(js|jsx)$/i,
        loader: "babel-loader",
        exclude: /node_modules/,
      },
      {
                test: /.(sass|less|css|scss)$/,
                use: [
                    
                    "css-loader", "sass-loader"],
            },
     {
        test: /.(jpe?g|png|svg)$/,
        use: [{   
          loader: 'file-loader',
          options: {
            name: '[hash].[ext]',
            outputPath: 'images'
          },
        }]
      },
    ],
  },
};

module.exports = () => {
  if (isProduction) {
    config.mode = "production";

    config.plugins.push(new MiniCssExtractPlugin());
  } else {
    config.mode = "development";
  }
  return config;
};
  • dist
  • node_modules
  • src
    • assets
      • image
    • scss
    • index.js
  • index.html
  • package.json
  • webpack.config.js

How do I get this element?

I am trying to use Puppeteer in order to scrape this element from ebay: Text however when I run my code I get an error that says “Cannot read properties of null (reading ‘textContent’)” this is my code:

    const browser = await puppeteer.launch({ headless: false });

    const page = await browser.newPage();
    await page.goto('https://www.ebay.com/sch/i.html?_from=R40&_nkw=Blastoise+%282%2F102%29+%5BCelebrations%3A+Classic+Collection%5D&_sacat=0&Graded=No&_dcat=183454&rt=nc&LH_Sold=1&LH_Complete=1');

    await page.waitForSelector('.s-item');


  
  let cards = await page.evaluate(() =>{
    let cardElement = document.body.querySelectorAll('.s-item')
    let cards = Object.values(cardElement).map(x => {
        return{
            date: x.querySelector('.s-item__title--tagblock span.POSITIVE').textContent ?? null
        }
    })

return cards
  })
  

  console.log(cards)
})()
``` How can I solve this?

How can I solve this in Java?

Write a program that edits a text file to display each complete sentence with a
period at the end in a separate line. Your program should work as follows: Create
a temporary file, copy from the source file to a temporary file and perform the
required operation. Copy the contents of the temporary file back into the source
file. Use a method (or methods) in the class File to remove the temporary file.
You will also want to use the class File for other things in your program. The
temporary file should have a name that is different from all existing files so that
the existing files are not affected (except for the file being edited). Your program
will ask the user for the name of the file to be edited. However, it will not ask the
user for the name of the temporary file, but will instead generate the name within
the program. You can generate the name any way that is clear and efficient. One
possible way to generate the temporary file is to start with an unlikely name, such
as “Temp1”, and to append a digit, such as ‘1’, until a name is found that does
not name an existing file.

JS: manipulating an API response to have part of the Object as a Key?

I have data that comes back from an API as an array of Objects.

const data = 
  [

      { 
        name: "Charles",
        age: 42, 
        height: 76
      },
      { 
        name: "Jim",
        age: 32, 
        height: 56
      },
      { 
        name: "Ed",
        age: 22, 
        height: 76
      }
  ]

rather than just returning that, return data, I’d like to have it where the name is the key so that I can do a lookup on data, like data["Jim"] and get the object back.

const data = 
      [
         {
          "Charles": 
             { 
               age: 42, 
               height: 76
            },
         },
         {
          "Jim": 
             { 
               age: 32, 
               height: 56
            },
         }
     ]

how can I manipulate the data to come back that way after getting it back from the API in the original format listed first??

Another Mongoose CastError: Cast to ObjectId failed for value

I know there are a thousand of these questions, but this one really has me stumped. I’m building a simple Express app that uses a REST architecture. Here is the code I had in index.js before the error appeared:

// Index
app.get('/library', async (req, res) => {
    const { album } = req.query;
    const tracks = await Track.find({ album: album });
    const albums = await Album.find({});
    res.render('index', { tracks, albums, album });
});

// New
app.get('/library/newtrack', async (req, res) => {
    const albums = await Album.find({});
    res.render('newtrack', { albums });
});

app.get('/library/newalbum', async (req, res) => {
    const albums = await Album.find({});
    res.render('newalbum', { albums });
});

app.post('/library', async (req, res) => {
    const { type } = req.query;
    if (type === 'track') {
        const { title, artist, source, album } = req.body;
        const track = new Track({ title, artist, source, album });
        await track.save();
        res.redirect(`/library?album=${track.album}`);
    } else if (type === 'album') {
        const album = new Album(req.body);
        await album.save();
        res.redirect(`/library?album=${album.title}`);
    }
});

Then I added my Show route, which looks like this:

// Show
app.get('/library/:id', async (req, res) => {
    const { id } = req.params;
    const albums = await Album.find({});
    const track = await Track.findById(id);
    res.render('show', { track, albums });
});

Now when I submit the form to create a new track or album, I get this error:
CastError: Cast to ObjectId failed for value “app.css” (type string) at path “_id” for model “Track”
app.css is served using express.static and is linked to inside of an EJS partial. I don’t understand what the css file has to do with the error.
If it helps, here is newtrack.ejs:

<%- include('./partials/head') %>
    <%- include('./partials/nav') %>

        <h1 class="text-center mt-5">New Track</h1>
        <form action="/library?type=track" method="post">
            <label for="title">Title</label>
            <input type="text" id="title" name="title">

            <label for="source">Source</label>
            <input type="file" name="source" id="source">

            <label for="artist">Artist</label>
            <input type="text" name="artist" id="artist">

            <label for="album">Select Album</label>
            <select name="album" id="album">
                <% for (let i=0; i < albums.length; i++) { %>
                    <option value="<%=albums[i].title%>">
                        <%=albums[i].title%>
                    </option>
                    <% } %>
            </select>
            <button>Create New Track</button>
        </form>

        <%- include('./partials/foot') %>

How to check if scrollbar thumb is visible? (part of scrollbar that gets dragged around)

For my application, the scrollbar is always present as a placeholder — whether or not it is actually functional (or if a thumb exists). As a result, checking if a scrollbar is visible does not help. To get around this, am trying to detect if the scrollbar is active by checking the thumb.

With ::-webkit-scrollbar, would assume it is possible to check the thumb’s height. However, it is not fully supported across browsers. Is there another way to check for the presence of a scrollbar thumb?

Why does my AJAX request fail if a file isn’t provided?

I have a page that takes in a file, name, email, and user comments. For now, the page requires all 4 entries. I’d like to make the file upload optional while requiring a name, email, and a comment. I already have some JS telling the user that a name, email, and comment are required. Currently, if the user doesn’t supply a file, the AJAX fails and returns a message I put together that says, “Could not reach the server, please try again later.”.

My question is, why does the AJAX fail if a file isn’t supplied? This section of the PHP doesn’t assign errors or help complete any kind of DOM manipulation, it simply processes the file if one is provided, or doesn’t.

Here’s the JavaScript:

$(document).ready(() => {
    // When the submit button is clicked, capture the contents of the form.
    $("#testing_data").submit((event) => {
        // The two lines below remove the danger alert when the user hits "send" after the user forgets to fill in a field.
        $(".form-group").removeClass("alert alert-danger");
        $(".help-block").remove();

        var formData = new FormData($('form')[0]);  // Create a formData object using the contents of the first form on the page.  The form object keys are using the elements' names, not the ids.

        $.ajax({
            method: "POST", // The HTTP method to use for the request
            url: "./root/php/sendCombinedFormData.php",  // The string to which the request is sent.
            contentType: false, // Setting this to false prevent jQuery from sending a content type header.
            processData: false, // Setting this to false lets us pass a DOM document, or other non-processed data through the request.
            encode: true,
            data: formData, // Data being sent to the server, sometimes referred to as "payload".
            dataType: "json", // Data type coming back from the server.
        }).done((data) => { // Once AJAX is complete, the arrow function uses "data" as it's parameter which is passed back from the server.
            if (!data.success) {
                if (data.errors.name) {
                    $("#name-group").addClass("alert alert-danger");
                    $("#name-group").append(
                      '<div class="help-block">' + data.errors.name + "</div>"
                    );
                }
                if (data.errors.email) {
                    $("#email-group").addClass("alert alert-danger");
                    $("#email-group").append(
                      '<div class="help-block">' + data.errors.email + "</div>"
                    );
                }
                if (data.errors.comment) {
                    $("#comment-group").addClass("alert alert-danger");
                    $("#comment-group").append(
                      '<div class="help-block">' + data.errors.comment + "</div>"
                    );
                }
            } else {
                $("#testing_data").html('<div class="alert alert-success">' + data.message + "</div>");
            }
        }).fail((data) => {
            $("#testing_data").html('<div class="alert alert-danger">Could not reach the server, please try again later.</div>');
        });

        event.preventDefault();
    });
});

Here’s the PHP:

<?php
    include_once '../utilities/MSSQLTestServerConnection.php';

    $errors = [];
    $data = [];

    // Upload user information section.
    // Check if the user provided a name, email, and comment.
    if (empty($_POST['name'])) {
        $errors['name'] = 'A name is required.';
    }

    if (empty($_POST['email'])) {
        $errors['email'] = 'An email is required.';
    }

    if (empty($_POST['comment'])) {
        $errors['comment'] = 'A comment is required.';
    }

    // Process file if one is provided.
    $file = $_FILES['file'];
    $fileName = $_FILES['file']['name'];
    $fileType = $_FILES['file']['type'];
    $fileTmpName = $_FILES['file']['tmp_name'];
    $fileSize = $_FILES['file']['size'];
    $fileError = $_FILES['file']['error'];
    $fileExt = explode('.', $fileName);
    $fileActualExt = strtolower(end($fileExt));
    $fileNameNew = uniqid('',true).".".$fileExt[1];
    $fileDestination = '../uploads/'.$fileNameNew;
    move_uploaded_file($fileTmpName, $fileDestination);

    // Prepare data for ajax and run SQL update query to record user information.  Ajax uses success=false or success=true to manipulat DOM.
    if (!empty($errors)) {
        $data['success'] = false;
        $data['errors'] = $errors;
    } else {
        $data['success'] = true;
        $data['message'] = 'You successfully submitted your comment!';

        $name = $_POST['name'];
        $email = $_POST['email'];
        $comment = $_POST['comment'];

        // Update the database with the data that was entered in the form.
        $sql = "INSERT INTO tblOGTestingComments (Name, Email, Comment) VALUES ('$name', '$email', '$comment');";
        sqlsrv_query($conn, $sql);
    }

    // Return $data to the browser where AJAX will use it to manipulate the DOM.
    echo json_encode($data);
?>

Here’s the HTML if that helps:

<div class="container" id="testing_section">
    <div class="row">
        <h4>Testing Comments</h4>
        <form id="testing_data" method="POST" action="" enctype="multipart/form-data" >
            <div
                id="file-group"
                class="div mb-3 form-group"
                style="width: 400px">
                <input
                    type="file"
                    name="file"
                    id="file">
            </div>
            <div
                id="name-group"
                class="mb-3 form-group"
                style="width: 400px">
                <input
                    type="text"
                    class="form-control"
                    placeholder="Name"
                    name="name"
                    id="name"
                    aria-label="Name"
                    aria-describedby="Name">
            </div>
            <div
                id="email-group"
                class="mb-3 form-group"
                style="width: 400px">
                <input
                    type="email"
                    class="form-control"
                    placeholder="Email"
                    name="email"
                    id="email"
                    aria-label="Email"
                    aria-describedby="Email">
            </div>
            <div
                id="comment-group"
                class="mb-3 mt-1 form-group">
                <textarea
                    type="text"
                    class="form-control"
                    placeholder="Leave a comment here"
                    name="comment"
                    id="comment"
                    aria-lable="Comment"
                    aria-describedby="Comment"
                    style="height: 90px"></textarea>
            </div>
            <div class="mb-3 text-start">
                <button
                    type="submit"
                    name="uploadBtn"
                    value="Send"
                    class="btn btn-success"
                    autocomplete="off"
                >Send <i class="bi bi-send"></i>
                </button>
            </div>
        </form>
    </div>
</div>