How can I create an add folder functionality to my React CMS application? - reactjs

Click here to see a picture of what I mean
I haven't tried anything yet because I'm not sure how to even approach this problem. I'm not even sure what to Google. I do, however, have a pretty good handle on React. Thanks!
Update: The folders will not be storing files, just hyperlinks.

You need to model the problem space first. i.e. models for folders, and files. Each having properties (name, etc.) and associations (folders can have many files and subfolders).
To store the physical files you can use a third-party service like Amazon S3.
This would get you started at least.

Related

Best way to transfer database to new website without access to previous one

I has old website, which I miss dashbored login info, so I didn't has access to its database
Now I implement new one, what the best way to extract previous data (mp3 files, articals, mp4 files) to use it in new one.
I hope there is a way to extract its not manually
Thanks
I'd suggest in future all extraneous matter, images, mp3s etc. be held in a separate folder on your server, and hyperlinked to where they appear on a page.
That folder can be downloaded for safe-keeping.
.
In this case, I can only suggest that if the website is still up ( since you've simply lost the keys ), as an ordinary user you could download the whole website [ which wouldn't include the database ] with something like wget or Httrack to your computer, and from that extract what items are possible to your computer [ filtering by extensions if need be ].
At the very least you should get an idea of which items were present, even if they don't download.
As for articles, either the website online, or the downloaded website should display them in a browser, and you could copy the text.
None of this applies if the website is no longer online; but I wish you well whatever the outcome.

Indesign real-time package for collaboration

I manage a team of designers working on Indesign.
When we work on a project, it often happens that a designer has to work on the project of another. We work with Dropbox for Business.
But when we take the work of another designer, there is often missing links and fonts.
Is there a plugin or a way to develop a plugin that would allow, when we create a new indd file (or for the protection of the same file):
Automatically create a "Links" folder and another "Document fonts" at side of the indd file
Systematically add a new link or new typography in the corresponding folder?
To simplify: each action on font or on a link, make a kind of "Indesign Package" in real time?
If this is not a solution, do you have any solutions to meet this need?
I don't know of a specific script or plugin that does this.
However, it should be possible to write a script with an eventhandler with a beforeClose event that runs certain script commands every time a user closes a document (or even every time a user adds, changes or deletes a link). At this point the script could run some copyLink commands on all the images and fonts (?) placing them all in the folders next to the document.
The whole script could be made a startup script, so it becomes active anytime any user runs InDesign.
(I'm actually not sure, if fonts can be copied so easily. Worst case scenario would be that the script would need to run some packaging command to gather the fonts somewhere, copy them over to where you need them and then delete the rest of the temporary package.)
Did you consider Creative Cloud Libraries ? They are meant to allow sharing assets within a team. Apart form that, you users would need to have a same access to the file system (a common drive letter for the network path for example).
Another solution would be to use a DAM solution so users would link files from the DAM.
Eventually, you could sure think of a script as mdomino offered.

How can I predict links in box.net?

I'm a new user on box.net site and I've uploaded A LOT of .zip files that I want to use in my project.
The problem is that, normally, the share link is something like: box.net/1.zip .. so I can predict that the 100th file will be box.net/100.zip ... but this is not the case in box.net..
I cant obviously copy every files link manually since what I uploaded and need is ~1000 small .zip files and copying each files link will take ages.
So is there a way to fix this?
We recently released a new feature, where you can give your share a custom name. See the blog entry for more details on how to use it.
Right now, we have not exposed an API to set these custom links, but that will be coming soon.

How save text, svg, html, css all together efficiently

In an application, I am using Fabric.js, which lets users write text, draw SVG's, insert images etc.
I want to know, what is the best way to store this data.
Requirements are:
Ability to query the data(text), which tells me that i should store it in DB (MySQL as of now)
I have images, and I am targeting IPad as well, so the images are important, as to how they are stored.
SVG's and HTML/CSS to be saved as well.
I also want to do versioning of the content, as Quora does it, so that a user can see the changes from the past version to the current version. This also includes the versioning of images and SVG's.
I am wondering how Google Docs does it, because they also store our documents, drawings etc.
What is the best way of doing this?
i dont known if it helps but, Opera browser offer an option to save the webpages to an unique file { mht extension }, this stores all the files { css, images, scripts, etc } in base64 encoded text for a later use { when the document is opened }... maybe this can be a way to store data :P
I manage a webapp where users generate reports, and found it more efficient to store images and binary files in the filesystem, and link to them from the database. Elements that are in xml or text are kept in the database for easier searching - in your case this would include css/html and svg (which is xml). Use the database for managing revisions.
Might also check out this thread on storing images in a database.
It looks like Frabic.js is using the node.js javascript webserver on the backend - haven't used this before, but you might investigate which databases are easiest to use with node.js:
node.js database
nodejs and database communication - how?
nodejs where to start?
If you want to query the text efficiently, then perhaps putting all bits of information into the DB separately is the most efficient. Maybe you with to play with OOXML or ODF, that may serve as container for all information you require, and then XML-storage (e.g. eXist) to store it and query (e.g. the text). As these standards are XML-based, you can transform them into HTML (e.g. here or here) but writing an online editor for this is something that monster like Google can do.
You can take a look at NoSQL databases like MongoDB or
CouchDB
See also Storing images in NoSQL stores

CakePHP: Best practice for app-wide media-uploads

I'm trying to make an App-wide media-upload which should have the possibility of being accessible from every controller/model.
I thought of on table media which holds record of all uploaded files, my schema looks like this:
id
controller //to keep the reference from which controller the file was uploaded
foreign_key //since files should be uploaded to specific records, I need this id
filename
extension
fullname
size
created
modified
I'm not sure what would be the best approach in doing this. I've thought of components, plugins and a behavior but still am unsure.
My App has many different controllers with different records.
For example it manages projects and should now be able to attach PDFs to specific projects from within the project-edit mask.
Since this is a feature needed by other controllers, too I want to write it application wide.
I'm pretty sure I need a helper to call the upload-function from within the masks.
May something like: echo $this->Media->uploadMask(); which provides me with an ready uploading-mask for the controller and id I'm editing at the moment.
But I don't know which route I should call for the upload. Something like /media/upload would be very good, but I'm not sure if this fits correctly into the MVC-approach.
Would it be better to call it from my specific controllers? Or is an AJAX-upload to just a normal controller/model like better?
What you are describing is a Behaviour, which is basically an object of methods that can apply to any model. For controllers there are also Components.
There are already a couple of established upload behaviours for CakePHP you should check out: Meio Upload which is good for basic image manipulation and also the CakePHP Media Plugin which is more advanced and more recently updated.

Resources