I’m having a problem storing the image in the DynamoDB table.
I have a form where there is an id in it. a name and an image; regarding the image, the table shows the name of the image (therefore of type string
, example img_mountains_wide.jpg), while in the form there is a field of type file
.
So referring to the latter, as I see from my json array, the image is saved with all the full path; only if I go to the dynamo table I don’t see the path. ( EXAMPLE: in the array I get {“id”:”232643″,”name”:”mountains”,”image”:”C:UsersDesktopimg_mountains_wide.jpg”} while in the table I must have only img_mountains_wide.jpg ).
What should I do to fix this?
function myFunction() {
const data = {
id: document.getElementById('id').value,
name: document.getElementById('name').value,
image: document.getElementById('image').value,
};
<div class="container">
<form method="post" id="save" action="javascript:myFunction()">
<h1>Inserire articolo</h1>
<div class="field">
<label for="id">ID :</label>
<input type="text" id="id" name="id" />
</div>
<div class="field">
<label for="name">Name:</label>
<input type="text" id="date" name="name" />
</div>
<div class="field">
<label for="image">Image:</label>
<input type="file" id="image" name="image" />
<div class="field">
<button type="submit" class="full">Save</button>
</div>
</form>
</div>