Web Connection
String is too long to fit
Gravatar is a globally recognized avatar based on your email address. String is too long to fit
  RESCUECOM
  All
  Feb 18, 2017 @ 03:53pm

Hello, we are sending pdf files back and forth on the website and when large files > 16BM are sent the west-wind v5.7 breaks here: THIS.cOutput = this.cOutput + lcText (LEN(lcText) > 16MB)

Does 6.1 fix this issue or is there a work around?

Thank you,

David

Gravatar is a globally recognized avatar based on your email address. re: String is too long to fit
  RESCUECOM
  RESCUECOM
  Feb 18, 2017 @ 06:30pm

So here is the work around I came up with: IF LEN(lcresponse) > 15000000

  • dam 2-18-17
  • deal with lcresponse > 16MB
  • come up with unique file name: m->lcresponsefilename = m->servernum + ALLTRIM(STR(SECONDS())) + ALLTRIM(LEFT(STRTRAN(lcresponse,"&","-"),40)) IF STRTOFILE(lcresponse,m->lcresponsefilename) > 0 Response.transmitfile(m->lcresponsefilename) ERASE &lcresponsefilename ENDIF ELSE Response.Write(lcresponse) ENDIF

Then you have to handle the file receipt on the web side instead of the form post. If anyone has any thoughts, please chime in.

Gravatar is a globally recognized avatar based on your email address. re: String is too long to fit
  Harvey Mushman
  RESCUECOM
  Feb 19, 2017 @ 06:08am

The 16mb issue is a fairly well documented limit of VFP. But in the current version of WC there is away to handle the problem.

Looked at some old documentation for Version 5.x and here is a link that might help.

Uploading a file via HTTP

Gravatar is a globally recognized avatar based on your email address. re: String is too long to fit
  Rick Strahl
  RESCUECOM
  Feb 19, 2017 @ 09:23pm

This is a known issue due the string size limit of FoxPro. Web Connection receives the input buffers as string data and if that data exceeds 16 megs it won't work as the file buffer is manipulated in a variety of ways.

Luckily there are workarounds that involve client side uploads that essentially chunk the data sent to the server and put it back together on the other end.

Take a look at the File Upload Samples in the Web Connection 6.0 demos. It's limited to images, but you can specify what you can send and the two plUpload samples on the bottom support sending files larger than 16 megs (if you remove the filters). The other benefit of these solutions is that they can provide feedback for larger uploads rather than just sitting and whatching a non-changing screen.

+++ Rick ----

Gravatar is a globally recognized avatar based on your email address. re: String is too long to fit
  Rick Strahl
  FoxInCloud Support - Thierry N.
  Feb 20, 2017 @ 11:15am

Thanks Thierry. Fixed.

Here's the link again:

The two bottom links use plUpload and can be used to upload files greater than 16 megs - although the sample doesn't support that since it's limited to images and something like 2 megs for uploads but that's explicitly imposed by the sample.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: String is too long to fit
  RESCUECOM
  Rick Strahl
  Feb 23, 2017 @ 08:50pm

Hello Rick,

I have the following code on the server: Response.TransmitFile("."+m->lcresponsefilename)

The webserver can tell its an 18MB file, but the call to: lnElement = ASCAN(this.aItems,lvKey,1,this.Count,1,7) && Case insensitive/exact on Yield lnElement = 0

I then recieve the following from the webserver: You return me a txt/html string. There is no file. Please check and fix.

Unable to read file
Unable to read file

Couldn't read the requested file on the server. Most likely permissions don't allow access to the requested file.

Any thoughts?

Thank you

David

Gravatar is a globally recognized avatar based on your email address. re: String is too long to fit
  Rick Strahl
  RESCUECOM
  Feb 24, 2017 @ 02:02pm

So first of all you need to provide more info. What are you doing exactly? The error you're seeing has nothing to do with the transmit file operation. You can step into the code and see where and what is failing. Without that info we're unlikely to be able to help you.

TransmitFile() doesn't read the file into memory, it just passes the file name on to IIS which will then serve the file on your behalf. If you're getting the error you describe something else is firing in your page that causes that error. It looks like it might be framework code but who knows. You need to step into the code...

+++ Rick ---

© 1996-2024