Comments (5)
Hello,
In your example I can't see exactly where you're initializing you backgroundImage
base64
image, so I can't say for sure that there's not a problem with that base64
string.
I can say that we have a really nice example in the ./example
folder where we load a .svg
as the baseImage
for an input. You can see this live in the demo page on the right box (just remove the preloaded images and you'll see the baseImage
). Take a look at the ./example
folder code to see exactly how that is coded.
My advice would be for you to first set up the baseImage
using a local image option, like a local .png
or .svg
, then, once you have that working correctly and you know everything is set up well, you can work on getting the base64
version to work, as it should really not require any further updates.
Let me know if you still have trouble, thank you.
from file-upload-with-preview.
Instead of using external file is the any inbuilt solution. Or can i use CSS
like using background-color:
?
because i tried this
const importedBaseImage = require('./download.svg'),
var upload = new FileUploadWithPreview('myUniqueUploadId', {
maxFileCount: 4,
text: {
chooseFile: 'Maximum 4 Images Allowed',
browse: 'Add More Images',
selectedCount: 'Files Added'
},
images: {
baseImage: importedBaseImage,
},
});
i get error here var upload = new FileUploadWithPreview('myUniqueUploadId', {
saying Uncaught SyntaxError: Unexpected token 'var'
from file-upload-with-preview.
Hello, no - at the moment you cannot use a background-color
for this.
In your example, I think you need to remove the ,
after the first line - that's why you're getting the error message. So, make it like this, it should work:
const importedBaseImage = require('./download.svg');
var upload = new FileUploadWithPreview('myUniqueUploadId', {
maxFileCount: 4,
text: {
chooseFile: 'Maximum 4 Images Allowed',
browse: 'Add More Images',
selectedCount: 'Files Added'
},
images: {
baseImage: importedBaseImage,
},
});
from file-upload-with-preview.
Tried above method and got this error,
car.php:377 Uncaught ReferenceError: require is not defined
(anonymous) @ car.php:377
after little research found this https://stackoverflow.com/questions/45723462/javascript-error-uncaught-referenceerror-require-is-not-defined
is there any solution without using external library ?
from file-upload-with-preview.
I think has to do with an error in the formatting of your javascript in your .php
file. Check your script tags as that may help. I'll close this for now, thanks.
from file-upload-with-preview.
Related Issues (20)
- How to access already added images while editing a form? HOT 2
- FileUploadWithPreview is not a constructor (extended with examples) HOT 2
- May I use html_form submit to backend? HOT 2
- how to capture the event with jquery? HOT 1
- There is no name attribute to get the image on backed HOT 4
- Beginner overloaded HOT 2
- Can I use this inside react [just react] ? HOT 2
- Name attribute not present in sending request to server. HOT 6
- file_upload_with_preview__WEBPACK_IMPORTED_MODULE_4__.FileUploadWithPreview is not a constructor HOT 4
- Use in Next js and Tailwind HOT 3
- bug on chooseFile label HOT 2
- Question: can I attach event to element, not to window? HOT 12
- Save in local storage HOT 2
- How to attach to previously initialized instance of FileUploadWithPreview? HOT 4
- How to dynamically click the clear button? HOT 1
- Added event confusion with presets and new add HOT 3
- IE11 HOT 3
- How to Change Input file label? HOT 1
- Need to Show The Browse Button HOT 1
- Rendered order of PresetFiles
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from file-upload-with-preview.