Pvxweb File Upload

Started by martinp, March 26, 2022, 05:28:17 PM

Previous topic - Next topic

martinp

Is there a way to receive a file with the pvxweb server?  (Web browser uploads file to pvxweb serevr)

I was able to do it by using apache and PHP, but I was curious if I can handle the POST of the binary file through the pvxweb server alone?

Thanks.

Mike King

Sure, although using the PxPlus Apache or EzWeb server makes it a little easier.

With the PvxWeb server you have to parse the data out of the body received, whereas the PxPlus Apache or EzWeb provide the file contents directly. 

Also Webster+ has an [upload] short code that makes file uploads even easier. Our Webster+ demo system actually shows doing this for images and data file downloads and uploads. 

Basically when using Webster+ the system automatically places the uploaded file contents in a temporary file for you so all you need to do is rename/copy that file. 

For example (from the demo site)

[upload imagefile$ size=20/4.5  event=uploader@product]Click or drag new image here to change[/upload]

This short code will provide a file upload region that when clicked or has a file dropped on it, will place the file contents in a temporary file, puts that file name in the variable imagefile$, then fires the event "uploader@product" (i.e. run uploader passing it event "product").
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

martinp

Thanks for the ideas Mike!  Perfect.

Martin