Issue uploading specific PDF documents within my Laravel CRM application - ajax

I was hoping someone could shine some light on a strange issue I have stumbled across recently within my Laravel CRM application. I am using MultiCRM + Laravel BAP to operate a small CRM system on my server.
The issue I am experiencing is that when I upload "specific" PDF documents through the CRM's AJAX file uploader, the file uploads and reaches the 100% stage and thereafter the following error is being returned:
Unprocessable Entity
I have reviewed the error status/message within the Network tab of my Developer Console and I am seeing the following error:
The given data was invalid - The files must be a type of Jpg, jpeg,
png, pdf, txt, doc, docx
Some PDF's I can upload perfectly fine whereas other PDF's seem to be failing. I have checked the Properties of the file which I am attempting to upload and I can confirm that the file extension resembles the exact same of the PDF files which are uploading perfectly fine.
I have also reviewed the max_upload_size and post_max_size within my php.ini and I can confirm the values set in there are fine. I have tried to upload larger zip files 20mb+ to rule out any file upload size limits, and I can confirm that the zip files in question uploaded and saved perfectly fine.
I am just a little confused with why certain PDF files will upload and others won't.
If there any particular files which you should need to see, please let me know and i would be happy to provide the source code :-)

Related

Laravel's Storage::put not saving file based on original uploaded file extension. (e.g. Uploaded .ai saved as .pdf)

I'm trying to upload an Adobe Illustrator (.ai) file and using Storage::put() saves the file as a pdf.
Problem
This is the uploaded file.
Upon multiple attempts, I've confirmed that they're all saved as .pdf.
How do you solve this issue ?
Upon peeking into the AI file, I've found that this is the reason why it's picked up that way.
I have not understood why the saved file has its extension changed, but using Storage::putFileAs() instead of Storage::put() solves my current problem. It is most likely a bug in Laravel framework.

TCPDF display blank page suddenly in Laravel

I used TCPDF in Laravel project for output pdf that was couple weeks ago. It worked perfect. I copy the project folder for backup. Today I tried to output pdf. Error 503 shows up. so I used backup data but it also problem browser ask me to open pdf or save pdf, when I open it it's all white blank pdf page. I'm guessing Is it my CDN problem?
I need pdf output function. Could you teach me what is cause please? and also if you have recommendation. I would like to know other PDF output library.

Bigcommerce uploading theme error

I downloaded the current theme, unzipped it, put some custom html, then zipped it, then reuploaded it. The uploading is successful however the processing failed. It showed a message:
There was a problem processing your theme
I tried renaming it and removing the html I inserted but it still happens.
If you are using a Stencil theme, you will need to bundle it with Stencil CLI before uploading:
https://stencil.bigcommerce.com/docs/bundling-submitting
If you are using a Blueprint theme, it should be uploaded to the template folder in WebDAV as described in this article: https://support.bigcommerce.com/articles/Public/Transferring-a-Custom-Theme-from-One-Bigcommerce-Store-to-Another
I ran into a similar issue last night. What resolved it was making sure none of my config.json strings were over the 64 letter limit for URLs. Once I removed these, my theme was able to be uploaded successfully.
UPDATE:
The urls that affected my bundle were located in the 'settings' section of my config.json. Don't worry about the meta section (your 'documentation_url' can be left how it is). I began getting the error after building out my schema.json file. After I connected my ID's in my schema.json file to the correlating ID's in my config.json file I started getting errors. I tracked down the ID that was causing the problem and it happened to have a string that was over 64 characters long. Once I removed the string my errors went away and the theme uploaded correctly.

Flask-WTF FileField Uploaded file disappears after a couple days and doesn't show up in the folder

So I'm just using the FileField to add files to the server and it worked the time I tested it on Heroku (by worked I mean the image was rendering properly, granted I should be using some more proper ways to render images), but after a couple days I checked again and the image is no longer rendering properly. I checked my uploads folder and the image is not there any longer (one of the old images were).
I ran the test again and the image is showing but the picture file is not in the uploads folder (despite the image showing). I checked on my local machine with the same code and the image uploaded showed up in the uploads folder.
I have no clue what's going on... It would be great if someone could shed some insights!
Thanks!
The "problem" (it is in fact by design) is with Heroku. Every time your application restarts (when a new change is pushed to your Heroku application or when it restarts after inactivity) your app is recreated and all stored data is gone. Most people use an external service for persistent files/data such as Amazon S3.

Cannot delete particular file

I am developing gallery viewer app. App will fetch the image file from Isolated Storage and will show in an image control. Most of the things are already setup and working fine.
Now images are stored in folders which act as album and user can delete the whole album. I tested with many many folders with assorted images and delete works fine. But I see that when there is a particular image file of name "XXXX.jpg", it doesn't get deleted. Although all the images from folder are shown in image control. That file doesn't gets deleted, and an exception is thrown "ArgumentUnhandledException". I tried after renaming the file but earth didn't move.
Also, for testing purposes I am transferring folders(with images in it) using "Windows Phone Device Manager". I know it is not official to use it, but it makes testing easy. Also peculiar thing is that "Windows Phone Device Manager" also cannot delete that particular file, although I dumped that file in app's isolated storage using "Windows Phone Device Manager". So I think that there is some problem with that file.
How can I delete the file. And if I cannot, how can I know it before hand that some files cannot be dealt with properly and should not be dumped in Isolated storage.Here is that file. File is inside zip file. I think file is required and not not just uploading image to a image hosting site. Please take a look. Also try not to look over the content of image file, that's only random file which is not working and I want to know why.
I found that file was marked read-only and was causing problem when a delete attempt was made. Removing read-only solves the problem.

Resources