My knowledge about Web technologies is very low and I just wanted to know if the following scenario would be possible with HTML5 and Javascript:
If I host an HTML file in Dropbox and send this link to seomeone, would it be possible that this HTML file creates a new file in my Dropbox? For exampe the HTML file is a form that one can fill out, can the HTML file create a text (.txt) file with the form content?
As far as I understand, the HTML file has to be hosted by a webserver and has to allow Javascript or PHP to achieve this. But maybe there is a way to just use an HTML file, a dropbox and a browser?
Any hints what topics I should study to achieve this goal?
On what I've understood from Dropbox, it does not directly show you the file contents in any manner. You can store files there, but the only thing you can see when opening a link that directs to the file, is the page which allows you to download the file to your own PC and save it.
This would seem like an impossible thing to achieve, in any cloud service like Dropbox it would seem. I would recommend you to just get the web hosting service, they are usually not that highly priced after all.
You could do this, but you shouldn't. To make this work, you'd have to use the Dropbox API to upload files, and you'd have to embed in your web page an access token for your account. That means anyone who looked at the source of your web page could get access to make changes in your account (e.g. delete all your files). So there's no safe way to do this without a server-side component (like PHP).
Related
Hi Stack Overflow community,
I'm a bit of a noob here (please be gentle) and wanted to ask how to upload HTML/CSS + Packages in bulk to my site.
I'm familiar with the code injection/CSS editor within Squarespace, but something doesn't seem to be working.
To summarize, I received a bunch of files and was requested to upload them to the website I manage. These files contain:
HTML (by page)
CSS (by page)
image files
index.html
Scripts file (which include .js & .php
sitemap.xml
That being said, I know there is a lot of referencing between these files and wanted to know the best route in incorporating these into my site?
Thanks so much!
A quick way to upload multiple files is to use the (S)FTP protocol. You can use an FTP client such as FileZilla to upload files in bulk to your server.
However, I'm not quite sure if that's possible in your use case. Are you using Squarespace for your project? If so, it looks like you can use either Git or SFTP for file uploads. You'll need to have developer mode enabled for that, though.
I found this article that goes into uploading multiple files to Squarespace via their own upload system, does that help?
As we all know, the infopath forms service residing on a sharepoint server generates a web site each time we publish an inforpath form template to the sharepoint server.
Here is the question: how does sharepoint do that. Is there any way for us to do that programmatically via some kind of api provided by MS?
In fact, what I need to do is getting all the html, js, css etc. files and applying some kind of operations like deleting some divs or insert some html code into the particular web page. I have come up with two ways to do this.
Generating the web page via sharepoint api and apply those operations at the same time
Extracting the web page files from the IIS server and apply those operations
I am totally new to this kind of work. All in my mind is that each time we right click on a web page in the browser and choose to save the web page, the browser gets some of the files we need to render the web page and makes it possible for us to browse the web page offline.
httrack
WinWSD
and tools like that seems to work fine with extracting html files from online web pages but not that well with js, css files.
Now I am trying to dig into the chromium project for some kind of inspiration, although whether it helps or not is unpredictable.
Any kind of advice will be appreciated.
Best Regards,
Jordan
Infopath xsn files are just zip files with a different extension. you can rename the extension to .zip and extract out the files. you will find a number of files that make up the form. the two main ones are the .xml and .xsl files. the .xsl will have the html to generate when applied to the xml.
is it possible to make a html download link, without using a server?
I have made some games, and I want to upload my stuff to my website.
The file is a zip.
Please help!
No, something needs to host the files (if you want to make the publicly available over the Internet). You do not need to run the server yourself, so you may be able to use something like Dropbox.
If you just want to share the files with another person, you can look into other protocols (SMTP/email, FTP, etc.) but your best bet is probably to upload the files to a file hosting solution.
Given that you say "to my website", I assume you have a site. Upload the .zip file to your server, and then link to it with
Download my ZIP file
You can change the href="{SOMETHING}" to contain the link to your ZIP file, and the text "Download my ZIP file" to whatever you want the link to say.
If your website is online, you can link directly to the file itself (be wary of exceeding your hostings bandwidth if the downloads pick up).
http://yourwebsite.com/yourzipfile.zip
and
Your Link"
You may need to purchase domain, hosting, and do some additional research on this whole process of getting a website online. You can use a web based FTP or a stand alone FTP client to upload your files onto a web server.
In our web based application we allow users to upload files.
I wonder if after clicking browse button we can restrict the list of available files to be uploaded by file extension. *.zip for example. Just to give the user easier way to find, select and click the file name.
I guess there will be javascript base solution but can I do it without javascript?
NOTE: this questions is only about making the browse dialogue to display less files.
In theory, <input type="file" accept="application/zip"> should work. Sadly, no mayor browser supports it...
You can use JavaScript to allow zip files only, but they will still appear in the list.
Edit:
For restriction purposes, you could use JavaScript, but you'd still have to perform server-side verification (with PHP, for example).
For a more convenient dialogue, you could use a Flash or Java Applet solution.
Links:
Flash Uploader
JUpload
Both allow you to limit the file extensions (among many other customizations).
It is not possible to set a file extension filter for the file browse dialogue. The best you can do client-side is to pass the file name through a javascript function on submit, and parse the extension to see if it is legal before proceeding with the upload.
Always bare in mind that your users will still be able to upload any files they choose, no-matter what you try to do client-side. You should always have a server-side check to ensure people aren't uploading malicious scripts.
I'm working on a web application that caches html pages and saves it on the user's computer. I want to create a link, so that the user can click on the link and access the cached webpage.
Following is my link to a cached page:
BBC
When I click on the link, nothing happens. I'm not even getting any error.
Can someone please suggest how to create a link to a cached html page?
First of all, not all browsers handle local files equally, indeed, not all computers will be running windows or have a C: drive. Secondly, you don't have much control over a user's cache. Cached pages are usually handled by the browser automatically. You can use headers to specify how a browser ought to cache files, but it's not even required to do so. You can read the W3C recs on caching for more information.
It's unclear what you're trying to do here, but it sounds like it might make more sense for you to use HTML5 local storage or offline files than trying to mess around with their file system directly. The security model of most browsers is such that web apps don't interact with local files, which may be why it's not working for you with your current setup. Dive Into HTML5 has a good overview of HTML5 local storage and offline pages.
Edited based on comment below:
Most browsers' security settings won't let a page on a website access files stored locally. Only locally saved files can link to other locally saved files. Therefore, if the page with a link is on a website, your link won't work. Try creating a link to your file from another locally stored file and see if that works.
Instead of providing the .html extension in the main page where you provide the link you should do something as below:
< href="file:///C:/Users/xxx/yyy/bbc">BBC</a>