PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Pvxweb File Upload  (Read 401 times)

martinp

  • Member
  • **
  • Posts: 19
    • View Profile
Pvxweb File Upload
« on: March 26, 2022, 05:28:17 PM »
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

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3698
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Pvxweb File Upload
« Reply #1 on: March 27, 2022, 12:13:57 AM »
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][/color]

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").

martinp

  • Member
  • **
  • Posts: 19
    • View Profile
Re: Pvxweb File Upload
« Reply #2 on: March 29, 2022, 10:43:44 AM »
Thanks for the ideas Mike!  Perfect.

Martin