Buy Now
Sign in

Upload File automatically on submit

W
WorldWideCode 5
July 17 2018 #379082
Hi,
I've a form designed to open support ticket.
On submit, I need to upload one file without user interaction for diagnostic reason.
This file is in a fixed path on client machine. How can I do this? File upload ghost value could help me?
Thanks in advance
Cheers
healyhatman 4.5
July 17 2018 #379083
So you want to without the user's interaction or consent, take a file off of their computer and send it to yourself?
That's not the way it works.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
W
WorldWideCode 5
July 17 2018 #379084
Thanks. Any idea about js approach?
healyhatman 4.5
July 17 2018 #379085
I cannot possibly imagine that what you're asking could be done.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
GreyHead 63.2
July 18 2018 #379107
Hi WorldWideCode,
If I understand correctly you need to access and upload a file on the user's computer at a fixed location e.g. C:\my_files\file_name.xxx I don't know if that is possible - I'd feel a bit uneasy if my browser started grabbing files from my system.
I guess it might be possible to use JavaScript to add a file path to a File Upload element but I haven't tried to do that.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
W
WorldWideCode 5
July 18 2018 #379114
Hi Bob,
yes I would need to do that but I realized it's quite hard becuase of of browser protection. Actually the behavoiur makes sense.
I first tried to add this path to file upload element. Watching content with debug print after submit, I noticed it reference file by name and not by client full path.
Probably because after submit, file has already been uploaded.
So I don't know to add client reference....
healyhatman 4.5
July 18 2018 #379120
After a bit more research - no. What you're asking cannot be done, for very obvious and very good reasons.
To make things a LITTLE easier you can have a link above the file upload button that, when clicked, will copy the path and filename to the clipboard (i.e. Ctrl+C), and have them paste that into the file browser that pops up to more quickly select the correct file.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
W
WorldWideCode 5
July 19 2018 #379128
Hi healyhatman,
thanks for your support.
I think your solution could be a valid workaround.
Cheers