#how can pass form to rust backend

28 messages · Page 1 of 1 (latest)

proud eagle
#

so as title i have a form that have some file input how can i pass this form to rust?

fervent raft
proud eagle
#

what is this

#

fakepath

#

i pass the path

#

but yhis fake path always passed not true one

#

its access issue right?

#

so i need to add this to allowlist

#
"path": {
        "all": true
      }
proud eagle
#

even in devtools i console loge it

#

and it give me fakepath

#

how should i fix this

fervent raft
#

How do you get your path ?

proud eagle
#

i make allowlist all to true but not work

#

idk how can i fix this

fervent raft
#

I mean what code do you use

proud eagle
#
    <form id="form" name="form">
        <select name="map" id="map-select"></select>
        <select name="agent" id="agent-select"></select>
        <br>
        <br>
        <label for="location">Location</label><br>
        <input name="location" type="file" accept="image/png, image/jpeg">
        <br>
        <label for="position">Position</label><br>
        <input name="position" type="file" accept="image/png, image/jpeg">
        <br>
        <label for="result">Result</label><br>
        <input name="result" type="file" accept="image/png, image/jpeg">
        <br>
        <br>
        <label for="note">Note</label><br>
        <textarea name="note" cols="40" rows="5"></textarea>
        
        <button type="button" id="save-btn">Save</button>
        <button type="button" id="cancel-btn">Cancel</button>
        </select>

    </form>
#
function getFormData() {
  let form = document.forms["form"];

  return {
    "map": form["map"].value,
    "agent": form["agent"].value,
    "location": form["location"].value,
    "position": form["position"].value,
    "result": form["result"].value,
    "note": form["note"].value
  }
}
fervent raft
#

Use tauri api dialog instead

proud eagle
#

for study

fervent raft
proud eagle
#

how can i end this thread?

#

i mean