Buy Now
Sign in

Upload File automatically on submit

WorldWideCode , July 17 at 10:48
W
WorldWideCode
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
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
W
WorldWideCode
Thanks. Any idea about js approach?
healyhatman
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
GreyHead
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
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
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
W
WorldWideCode
Hi healyhatman,
thanks for your support.
I think your solution could be a valid workaround.
Cheers