assets

Assets revisioning using angular custom builder

丶灬走出姿态 提交于 2020-06-17 13:27:26
问题 From this Stack Overflow question, I am trying to use a @angular-builders/custom-webpack:browser with a custom Webpack config that uses html-loader and file-loader in order to rename asset files with their hash content as well as each reference to them in the source code. The final purpose is to be able to cache the assets on in the browser but to guarantee that the user will always have the latest version of the asset (because if it changes due to a new release, the name of the asset will

Flutter. Check if a file exists before loading it

谁说我不能喝 提交于 2020-05-14 18:44:48
问题 What I want to do is load an image in a Material Widget to use it in a ListTile, but this asset might not exist. class MyImage extends StatelessWidget { final imagePath; MyIcon(String iconName) { try { // check if imagePath exists. Here is the problem imagePath = check('assets/$iconName.png/'); } catch (e, s) { // if not imagePath = 'assets/$iconName.png/'; } } @override Widget build(BuildContext context) { return Material(...here I will load the imagePath...); } } So, since I'm using a

angular - changing data in assets folder of the build

ⅰ亾dé卋堺 提交于 2020-05-14 11:50:31
问题 I want my angular app to work as a Standalone without a server. In the assets folder are images, sound-files etc. and one game.json file which contains the business data for the application (On a server this data would be stored in a DB or would be called via Rest). Everything works quite well. Using 'ng build' I can create the complete build which can be startet by opening the index.html in my OS - file manager without a http-Server. The problem is that I can't change the content of game

Check if asset exists

十年热恋 提交于 2020-04-11 04:19:08
问题 Is there any way to check if a asset file exists in Flutter before try to load the data? For now I have the following: String data; try { data = await rootBundle .loadString('path/to/file.json'); } catch (Exception) { print('file not found'); } The problem is, that I have to check for file 1, if this does not exits I have to check for a fallback file (file 2) and if this does also not exist I load a third file. My complete code would look like this: try{ //load file 1 } catch (..) { //file 1

Check if asset exists

时光总嘲笑我的痴心妄想 提交于 2020-04-11 04:18:00
问题 Is there any way to check if a asset file exists in Flutter before try to load the data? For now I have the following: String data; try { data = await rootBundle .loadString('path/to/file.json'); } catch (Exception) { print('file not found'); } The problem is, that I have to check for file 1, if this does not exits I have to check for a fallback file (file 2) and if this does also not exist I load a third file. My complete code would look like this: try{ //load file 1 } catch (..) { //file 1

Angular 6 error: CSSSyntaxError - Failed to compile

倾然丶 夕夏残阳落幕 提交于 2020-03-02 10:08:33
问题 Description I am receiving an error for the relative path in the url() that I mention for the 'background' property. When I use an absolute path for it, seems to be working fine. Error Message ERROR in ./src/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--15-3!./src/styles.scss) Module Error (from ./node_modules/postcss-loader/lib/index.js): (Emitted value instead of an instance of Error) CssSyntaxError: /home

在rails3.1使用assets pipeline with compass

天涯浪子 提交于 2020-03-01 14:19:57
assets pipeline是rails3.1中引入的重要特性之一,它的作用是让我们工程目录下面凌乱的js,css等文件,有序摆放。例如: 我们自己维护的、而且只在当前应用中使用的js、css可以放在app/assets目录中 我们自己维护的、但是会在N个应用中共享的js、css可以放在lib/assets目录中 我们自己不维护的js、css可以放在vendor/assets目录中 分门别类的好处是让我们可以在第一时间找到对应的js、css文件,同理可以扩展到其他的格式的文件,例如image。另外例如存在一个文件是app/assets/stylesheets/somecssfile.css ,那么我们就可以通过http://www.example.com/assets/somecssfile.css 这个链接访问到上面那个文件。 rails怎么识别这些路径呢?原来是在Rails.application.config.asserts.paths这个变量中定义的,我们可以在config/application.rb这个文件中修改,自定义一个assets目录,例如/home/myname/**/*/lib/assets,那么这个目录中的js、css文件同样可以使用 http://www.example.com/assets/stylesheets/anothercssfile.css

Correctly locating asset file with asset library

南楼画角 提交于 2020-02-25 08:46:05
问题 I'm using the asset library that comes with pyrocms for my cms and I have a set up like this for my assets. I am trying to figure out with the paths and namespacing how I can access the bootstrap.css file correctly with the documentation. http://docs.pyrocms.com/2.1/manual/developers/tools/assets I have updated my asset.php configuration file to look like this: $config['asset_paths'] = array( 'core' => 'assets/', 'globals' => 'assets/globals/' ); This is the line I have set up in my template

Image uploaded from the android app space seems corrupted

自作多情 提交于 2020-02-06 02:48:34
问题 In my android application, I need to upload a image in my Assets/Drawable/raw folder to the server. I tried the following: InputStream fileInputStream; if(imageChanged) { File file = New File("filename"); fileInputStream = new FileInputStream(file); }else { fileInputStream = ctx.getAssets().open("default.png"); } int bytesAvailable; byte[] buffer = new byte[102400]; while((bytesAvailable = fileInputStream.available()) > 0) { int bufferSize = Math.min(bytesAvailable, 102400); if(bufferSize

symfony2 access private files as admin user

眉间皱痕 提交于 2020-02-04 11:16:27
问题 In my Symfony2.3 project, i have a frontend website and a backend. The backend is secure by security.yml file and only role_admin user can acces backend. Want i want now is only admin users can download pdf files stores in assets. Is there a way to do this ? now, all visitors can access my pdfs files by url link. Do i have to move this pdf to another folder? or use an htaccess maybe? 回答1: You need to store these files in a location that is not directly accessible through your webserver. (i.e.