Hide load url for browser

8 views
Skip to first unread message

Javier Echaniz

unread,
Oct 4, 2022, 1:53:49 PM10/4/22
to Orbeon Forms
Hi, i`m new at orbeon and i have a form that download a file using xf:load and it works fine.

 <xf:load show="new" resource="http://localhost:8080/test/file.pdf"/>

I have noticed that the url is visible for the browser when i see the console output, and i would like to know if there is any way for dowloading the file without being visible the url to be safe from someone who could get the url. I've seen that with the fr:attachment, when you upload a file, the url that is stored seems to be encoded and i don`t know if it would be possible something similar to this.

Thanks a lot.

Alessandro Vernet

unread,
Oct 4, 2022, 7:35:12 PM10/4/22
to orb...@googlegroups.com
Hi Javier,

Would your URL serve the file if it was getting a POST instead of a GET? If so, in your model you can add a submission:

    <xf:submission
        id="my-submission"
        method="post"
        resource="http://localhost:8080/test/file.pdf"
        replace="all"/>

And then instead of your load, do:

    <xf:send event="DOMActivate" submission="my-submission"/>

You'll let me know if this works for your PDF.

-Alex

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/32c4d89d-5fd5-43d8-a2f6-dcf1c9b3bf95n%40googlegroups.com.

Echaniz

unread,
Oct 5, 2022, 5:03:29 AM10/5/22
to orb...@googlegroups.com
Hi Alex, 

I get the error : "An error has occurred while processing the request.", I'm trying to configure the log to see some extra information but im not able to. If i make the post with postman the url return the file ok.

Thanks.

You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/D0E3HmoI1FQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CANrzKk%3D_Cn_spex-8F%2BSD%2BPSTQC1pJ2SkVrnALBn%2BpfPsd3wcA%40mail.gmail.com.

Echaniz

unread,
Oct 5, 2022, 8:00:44 AM10/5/22
to orb...@googlegroups.com
Hi again, 

i don't know why but restarting the pc the problem has disappeared. 

Thanks

Alessandro Vernet

unread,
Oct 5, 2022, 11:43:13 AM10/5/22
to orb...@googlegroups.com
Javier, so you're saying that using a POST with an `<xf:submission>` ended up working?

Echaniz

unread,
Oct 5, 2022, 12:59:18 PM10/5/22
to orb...@googlegroups.com
Yes, they both work, using post and get with an <xf:submission>.

Thanks

Alessandro Vernet

unread,
Oct 5, 2022, 9:57:57 PM10/5/22
to orb...@googlegroups.com
Excellent Javier, and thank you for the confirmation.

-Alex

Reply all
Reply to author
Forward
0 new messages